I am not
sure if I am doing something wrong, or its a JVM or Xerces problem, I am
getting a "java.lang.InternalError" while parsing an UTF-16 XML if I
am using InputSoruce.setEncoding("UTF-16"). I attached my sample file
and a simple Sax parser class. I know I don't have to call the
setEncoding() function, the parser will detect itself, but it shouldn't a
problem even I set it.
BTW, this
problems happes to Xerces 2.4.0 and 2.5.0 with JVM 1.4.0_01 and
1.3.1.
Here is the
stack trace:
D:\work\source\xml>java SimpleSaxParser test.xml
UTF-16
afile=D:\work\source\xml\test.xml, encoding=UTF-16
Exception in thread "main" java.lang.InternalError: Converter malfunction (Unicode) -- please submit a bug report via ht
tp://java.sun.com/cgi-bin/bugreport.cgi
at sun.nio.cs.StreamDecoder$ConverterSD.malfunction(StreamDecoder.java:232)
at sun.nio.cs.StreamDecoder$ConverterSD.convertInto(StreamDecoder.java:248)
at sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java:294)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:179)
at java.io.InputStreamReader.read(InputStreamReader.java:167)
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
at org.apache.xerces.impl.XML11EntityScanner.skipString(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at SimpleSaxParser.parse(SimpleSaxParser.java:25)
at SimpleSaxParser.main(SimpleSaxParser.java:46)
afile=D:\work\source\xml\test.xml, encoding=UTF-16
Exception in thread "main" java.lang.InternalError: Converter malfunction (Unicode) -- please submit a bug report via ht
tp://java.sun.com/cgi-bin/bugreport.cgi
at sun.nio.cs.StreamDecoder$ConverterSD.malfunction(StreamDecoder.java:232)
at sun.nio.cs.StreamDecoder$ConverterSD.convertInto(StreamDecoder.java:248)
at sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java:294)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:179)
at java.io.InputStreamReader.read(InputStreamReader.java:167)
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
at org.apache.xerces.impl.XML11EntityScanner.skipString(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at SimpleSaxParser.parse(SimpleSaxParser.java:25)
at SimpleSaxParser.main(SimpleSaxParser.java:46)
thanks,
Benson.
��<