I am reading unicode character from XML like \u09A8\u09AC\u09AE. I have used <?xml version="1.0" encoding="utf-8"?> in the heading of XML. When I parsing xml from server using KXML2 parser it makes every unicode character a string. If I convert it to character array it gives like :
Char 0: \
Char 1: u
Char 2: 0
Char 3: 9
Char 4: B
Char 5: E
How can I get my unicode character back?
In XML
\u09A8is not a Unicode character reference in XML!There are only a few places that treat
\uas the beginning of a Unicode escape, and they are mostly in the Java area.In XML a hexidecimal Unicode escape would be
নand a decimal one would beন.In other words: You get the characters
\,u,0,9,B,Eback, because that's what the XML contains.The best solution is to fix whatever produces this XML to use actual numeric entity references. Alternatively, you can manually replace the
\uescapes with their corresponding characters, but then only your code will correctly interpret this non-standard XML.