Martijn Houtman <[EMAIL PROTECTED]> wrote:
>
> Using <?xml version="1.0" encoding="ISO-8859-1"?> returns a wrong encoding,
> but with <?xml version="1.0"?> everything is ok.
Ok, that is understandable. Because a Document must be created with a
byte-array (input stream), but from the body of a tag you get a java-string.
So the document is created like this:
doc = documentBuilder.parse(new
java.io.ByteArrayInputStream(body.getBytes("UTF-8")));
But if you specify explicitly that the encoding is not UTF-8, it goes wrong,
because a descrepancy is created then. UTF-8 is the default encoding for XML.
It is a small bug, because it could have considered the first line of input,
if that would contain an 'encoding' indication as you did, then it could
have automaticly avoided the inconsistentency.
On the other hand, the problem is small, because you can always not specify
the coding, UTF-8 can handle anything what you want.
I'v committed the bug in the bugtracker as bug number #6495.
Michiel
--
Michiel Meeuwissen
Mediacentrum 140 H'sum
+31 (0)35 6772979
nl_NL eo_XX en_US
mihxil'
[] ()