Hi I need to convert a hex string in UTF-16 to a hex string in UTF-8
i.e
String input ="0x0630"; //ARABIC LETTER THAL
I want the output to be a hex representation of the same charcter in UTF-8.
Does anyone know the java code to do this?
Printable View
Hi I need to convert a hex string in UTF-16 to a hex string in UTF-8
i.e
String input ="0x0630"; //ARABIC LETTER THAL
I want the output to be a hex representation of the same charcter in UTF-8.
Does anyone know the java code to do this?
Try this, I have no idea if it's the correct result
Code:final Character c = Character.valueOf((char) (Integer.parseInt("630", 16)));
System.out.println(Integer.toString(Charset.forName("utf-8").newEncoder().encode(CharBuffer.wrap(new char[] { c })).getChar(), 16));
Exactly what I was looking for!
Thanks for your help!