I am getting following encoded html as a json response and has no idea how to decode it to normal html string, which is an achor tag by the way.
x3ca hrefx3d
The term you search for are "UTF8 Code Units". These Code units are basically a backslash, followed by a "x" and a hex ascii code. I wrote a little converter method for you:
public static String convertUTF8Units(String input) {
String part = "", output = input;
for(int i=0;i<=input.length()-4;i++) {
part = input.substring(i, i+4);
if(part.startsWith("\\x")) {
byte[] rawByte = new byte[1];
rawByte[0] = (byte) (Integer.parseInt(part.substring(2), 16) & 0x000000FF);
String raw = new String(rawByte);
output = output.replace(part, raw);
}
}
return output;
}
I know, its a bit frowzy, but it works :)