[jdom-interest] document encoding

Ken Rune Helland kenh at csc.no
Fri Jun 29 03:03:10 PDT 2001


At 10:14 AM 6/28/2001 -0400, Elliotte Rusty Harold wrote:
>At 10:59 AM +0200 6/28/01, Ken Rune Helland wrote:
>
>>Maybe a FilterStream/FilterReader subclass that locks for
>>the <?xml ... ?> line and remebers the encoding declared.
>
>It's doable, but not as easy as you think. Make sure you pay attention to 
>the byte order mark, and use the heuristics listed in the XML spec. Be 
>careful to handle the case where there is not XML declaration. You cannot 
>just assume that the beginning of the file can be read as ASCII. In many 
>cases, it can't be.

Tanks for the hints, if I have time I will try it just for the
learning exsperience (byte order mark?).


KenR




More information about the jdom-interest mailing list