I have a string which is decoded by windows-1256 like this
A0C8E5CFC7CF2DC7DDDEE5ED
I want to encode that to UTF-8 in android. I tried to encode like this
String input = "A0C8E5CFC7CF2DC7DDDEE5ED";
try {
String message = new String(input.getBytes(), "windows-1256");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
but I didn't see what expected expression. I wrote some codes in C# for this purpose ,like this
int index = 0;
while (response[index] != 0x00)
result = result + Encoding.GetEncoding("windows-1256").GetString(response, index++, 1);
it works fine.
does anyone have any idea how to solve it?
Thanks in advance