View Full Version : Unicode in Java

03-27-2005, 10:15 PM
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
But when I am trying to System...print(s) I get
and I need that myString to contain "\uF3DA".
Do you have any suggestions?
Thank you very much.

04-21-2005, 10: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
good luck