...

View Full Version : Unicode in Java



nETbKA
03-27-2005, 09:15 PM
Hi
I have a String containing HEX values for example:
String myString="F3DA";
I would like to get the unicode that this HEX value represent.
I tried to make
Char ch='92'; // 92 in ASCII is "\"
and then
s=ch+"u"+myString;
But when I am trying to System...print(s) I get
myString="\\uF3DA"
and I need that myString to contain "\uF3DA".
Do you have any suggestions?
Thank you very much.

rix
04-21-2005, 09:32 AM
why don't you just use the escape character for "\" that trying to do it with parsing a string ?

now just from your example, this is what i came up with - hope it works like u wanted it to.


String myString="F3DA";
String s= "\\u"+myString;
System.out.println("myString: " + myString + "; s: " + s);

that \\ is the escape character in java for the \

then you get \n - new line
\t - tab
and so forth
anyways
good luck



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum