classpathx-xml
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Classpathx-xml] ReaderInputStream vs XmlParser declared and detected en


From: Mark Wielaard
Subject: [Classpathx-xml] ReaderInputStream vs XmlParser declared and detected encodings
Date: Sun, 05 Dec 2004 16:46:49 +0100

Hi,

When a DomLSInput gets a Reader to read the xml stream from it will
convert this to a gnu.xml.dom.ls.ReaderInputStream with a default
encoding of "UTF-16". This gives a bit of trouble when te aelfred2
XmlParser tries to guess the encoding (it "correctly" guesses UTF-16LE)
and detects that the XML document itself declares the document to have
another encoding.

When changing the default encoding of a ReaderInputStream to "UTF-8" I
can get much further with applications (like eclipse 2 and 3) that seem
to wrap all XML data into readers (since the documents that are read all
declare their encoding to be UTF-8). So I would propose to at least
change the default to "UTF-8" since I guess that is what most xml
documents will declare anyway.

   ReaderInputStream(Reader reader)
   {
     this.reader = reader;
-    encoding = "UTF16";
+    this.encoding = "UTF-8";
   }

But this seems a deeper problem with handling InputStream <-> Reader
interaction combined with XML documents that declare their own encoding.
I don't have a clue how to handle it properly though since when you use
a Reader you do that to hide the underlying encoding in the first place,
so it doesn't mix well with documents declaring their own encoding
format...

Cheers,

Mark

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]