|
-
Jun 1st, 2010, 06:54 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Hex conversion problem...
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?
Last edited by eakin; Jun 1st, 2010 at 09:30 AM.
-
Jun 1st, 2010, 08:49 AM
#2
Re: Hex conversion problem...
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));
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Jun 1st, 2010, 09:30 AM
#3
Thread Starter
Addicted Member
Re: Hex conversion problem...
Exactly what I was looking for!
Thanks for your help!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|