You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by "gentyjp@libertysurf.fr" <ge...@libertysurf.fr> on 2002/05/09 21:14:10 UTC

Problem reading UTF8 value with Java String

 Hi 

 Sorry for the question, it's the first time I use 
Xerces-J and I think I have a real newbie problem ...

 I have an XML String with a UTF8 value that looks like
this in my XML 
&#x642;&#x62B;&#x644;&#x647;&#x633;

 It's arabic UTF8.
 I have worked with this kind of string in C, using 
libiconv to code my string from CP1256 to UTF8 using 
libiconv and libxml to work on my XML, it works real fine.

 Now I have to do it in Java.

 When I encounter my TEXT_NODE, I do a getNodeValue, 
reading the value to a Java String, and write it to a 
file for instance.
 The value I retrieve seems real weird and I can't obtain 
the correct string. 

 My question is : what should I do to obtain my UTF8 
string ? ( I have simple ASCII/UTF8 values in my XML, and 
they work fine, and when I read my XML file with IE, for 
instance, it reads well, and I can see my arabic letters 
in it, in my XML file.)

 Perhaps my problem is more Java String with UTF8 ..

 Anyone can help me ?

  Thanks a lot.

  Jean-Paul Genty
--------------
Profitez des 2 offres exceptionnelles Tiscali !
"Internet Gratuit le Jour" et "Modem ADSL rembours�"
Cliquez ici, http://register.tiscali.fr/forfaits_ls/
Offres soumises � conditions.



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org