[jdom-interest] jdom

Laurent Bihanic laurent.bihanic at atosorigin.com
Wed Mar 31 23:45:27 PST 2004


M.Novosselov wrote:
> I got a few surprises while testing my program. I wrote test XML file in 
> notepad and saved it using UTF-8 encoding. To my surprise I got a 
> parsing exception thrown by SAXBuilder:
> root-element is missing. When I saved same file using other encodings - 
> everything worked fine (btw file with UTF-8 encoding had size 3 bytes 
> bigger than others).

When requested to saved in Unicode format (UTF-8 or 16), Notepad adds a 2, 3 
or 4-byte long "Byte Order Mark" (BOM) header to the file data (for more 
information: http://www.unicode.org/faq/utf_bom.html)
Some parsers handle this header correctly (Xerces) some don't (Crimson).


More information about the jdom-interest mailing list