I wrote a program in Java that reads through a Localizable.strings file for iOS localization and creates the counterpart for Android. The iOS files allow special characters, like accented characters (è, é, etc), but for Android these should be converted to decimal unicode representation (and included in an xml file).
When I grab the value from the Localizable.strings file, I attempt to replace these symbols using the following code:
value = value.replace("...", "…")
.replace("'", "\\'")
.replace("’", "\\'")
.replace("è", "è")
.replace("é", "é");
This successfully replaces ...
, '
, and ’
, but fails to convert the accented characters. I have read the answers here, but this does not address the same problem. What am I doing wrong, and how can I get this to work?