EDIT:
I am reading that string from a file, so this topic is actually about the following question:
I have this string which is the equal() to the one received from the file:
"Diogo Pi\\u00e7arra - Tu E Eu"
How can I make Java read the resulting string "\u00e7" as a "ç" character?
This happens because the file is not encoded in UTF-8 but in escaped Unicode, hence the reason why I am reading "\u00e7" as a string and not a Unicode character. So I need a function that parses this at runtime. I could iterate over .replace() functions to parse this but......
Old Question (asked in the wrong way before I understand what was going on, please ignore the following text):
I have the following string:
final String str = "Diogo Pi\u00e7arra - Tu E Eu";
and I want to convert it to:
"Diogo Piçarra - Tu E Eu"
I have tried everything, from Apache Lang tools unescape function, to
new String(str.getBytes("UTF-16"), "UTF-16")
or
new String(str.getBytes("UTF-8"), "UTF-8")
or
new String(str.getBytes("UTF-16"))
or
new String(str.getBytes("UTF-8"))
But nothing works...!
What can I try next?
Thanks!