How to replace � in a string

encoding, java, mojibake, string, unicode

Solution

That's the Unicode Replacement Character, \uFFFD. (info)

Something like this should work:

String strImport = "For some reason my �double quotes� were lost.";
strImport = strImport.replaceAll("\uFFFD", "\"");

Problem

I have a string that contains a character � I haven't been able to replace it correctly. ``` String.replace("�", ""); ``` doesn't work, does anyone know how to remove/replace the � in the string?

Original source

Related problems