Working with Xerces/Xalan with Unicode (UTF8) causes exeption if the text other then English.
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Dima_Gutzeit
Posted On:   Monday, October 14, 2002 08:27 AM

Hi there , Java maniacs :-) I am working with XML/XLS and I use Xerces and Xalan to transform XML to HTML. The task is to input some text to the XML file and then to present in HTML. I am using UTF8 encoding from within Java Servlet. When the text is in English everything works just fine but if the text is in some other language than Xerces gives an UTF8Reader Exception about invalid UTF8 format byte 2 out of 2. The version of Xerces and JDK are the most recent. I've converted the string to UTF in Java using : byte [] testArray = testStr.getBytes("UTF8"); testStr = new String(testArray,"UTF8"); Please advise.    More>>

Hi there , Java maniacs :-)
I am working with XML/XLS and I use Xerces and Xalan to transform XML to HTML.

The task is to input some text to the XML file and then to present in HTML. I am using UTF8 encoding from within Java Servlet. When the text is in English everything works just fine but if the text is in some other language than Xerces gives an UTF8Reader Exception about invalid UTF8 format byte 2 out of 2. The version of Xerces and JDK are the most recent.

I've converted the string to UTF in Java using :

byte [] testArray = testStr.getBytes("UTF8");
testStr = new String(testArray,"UTF8");

Please advise.

   <<Less
About | Sitemap | Contact