I am going to develop a J2ME application, where the application gets the complete dat from an XML file, for this have used kxml parser. And the parsing already done, but the problem arise after parsing, i.e., When I get a String of Unicode for a particular Word, then the application does not display the actual word, rather it displays the complete string of Unicode..
-------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<root>
<english>
<word val="\u0046\u006c\u0061\u0073\u0068">Flash</word>
</english>
</root>
--------------------------------------------
String str1 = ParseEvent.getValue("val"); //returns \u0046\u006c\u0061\u0073\u0068
String str2 = "\u0046\u006c\u0061\u0073\u0068";
Now, the problem is--
When I print str1 ,
System.out.println(str1); // Prints Flash
System.out.println(str1.length()); //Prints 5
But when I print str2 i.e.,
System.out.println(str2); // prints \u0046\u006c\u0061\u0073\u0068
System.out.println(str2.length()); //Prints 30
I am really fed up for this, please tell me, why they are doing this?
Any body who have worked or working on Unicode, please give me your email-Id.
My mail-id:: arindam@mob-tech.net