Removing Unicode Replacement Characters from String

367 views Asked by At

I'm working on an Android (Java) app that reads values from a BLE device and stores them in a database. This works pretty well, except that for some characteristics that I read and get the String value of, the String includes random replacement characters (�). If I ignore them the String is normal, but these characters cause problem when working with my database.

How can I remove any replacement characters like that from my Strings?

EDIT: I tried using regex to replace any replacement characters, and another replaceAll to replace anything that wasn't a standard character, but none of those seemed to work. But when I output the strings in a TextView, for some reason these characters are gone?

0

There are 0 answers