I have an android app that takes an ISO8859-1 (Latin1) file with data.
Essentially, Portuguese words whose characters I want to convert to the un-accented counterparts.
Yes, I googled a lot for this, and tried the
Normalizer.normalize(input, Normalizer.Form.NFD);
trick, and yes, I tried also
String.replaceAll("[áâã]", "a").replaceAll(....)....
but the string remains accented. I also tried messing with the project encodings, but not sure where to change (if this is a solution at all).
Ok, I found the answer. Just added “Latin1” when reading the InputStreamReader (it seems that, despite the config, it was assuming UTF-8 or something else).
So this is how I read the file now:
I needed to add an UnsupportedEncodingException.
Thanks for the previous answers,