Use String.replace , which performs a literal replacement, instead of String.replaceAll , which uses regular expressions.
Example:
"peque\\\\u0f1o".replace("\\\\", "\\")
String.replaceAll accepts a regular expression, so \\\\ interpreted as an expression \\ , which in turn matches one \ . (The replaceable string also has a special treatment for \ , so there is an error there.)
To make String.replaceAll work as you expect, you will need to do
"peque\\\\u0f1o".replaceAll("\\\\\\\\", "\\\\")
source share