<br><font size=2 face="sans-serif">If you use wordpad and save as a text document (not unicode text) then you don't get the 3 bytes added. A quick look with HexEdit shows what is actually in the file.<br>
<br>
/Phill<br>
IS Dept, Software Engineer.<br>
phill_perryman@mitel.com<br>
http://www.mitel.com<br>
Tel: +44 1291 436023</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>Laurent Bihanic &lt;laurent.bihanic@atosorigin.com&gt;</b></font>
<br><font size=1 face="sans-serif">Sent by: jdom-interest-admin@jdom.org</font>
<p><font size=1 face="sans-serif">01/04/2004 08:45</font>
<br>
<td><font size=1 face="Arial">&nbsp; &nbsp; &nbsp; &nbsp; </font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; To: &nbsp; &nbsp; &nbsp; &nbsp;&quot;M.Novosselov&quot; &lt;novosselovm@3web.net&gt;</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; cc: &nbsp; &nbsp; &nbsp; &nbsp;jdom-interest@jdom.org</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Subject: &nbsp; &nbsp; &nbsp; &nbsp;Re: [jdom-interest] jdom</font></table>
<br>
<br>
<br><font size=2 face="Courier New">Hi,<br>
<br>
M.Novosselov wrote:<br>
&gt; I got a few surprises while testing my program. I wrote test XML file in <br>
&gt; notepad and saved it using UTF-8 encoding. To my surprise I got a <br>
&gt; parsing exception thrown by SAXBuilder:<br>
&gt; root-element is missing. When I saved same file using other encodings - <br>
&gt; everything worked fine (btw file with UTF-8 encoding had size 3 bytes <br>
&gt; bigger than others).<br>
<br>
When requested to saved in Unicode format (UTF-8 or 16), Notepad adds a 2, 3 <br>
or 4-byte long &quot;Byte Order Mark&quot; (BOM) header to the file data (for more <br>
information: http://www.unicode.org/faq/utf_bom.html)<br>
Some parsers handle this header correctly (Xerces) some don't (Crimson).<br>
<br>
Laurent<br>
_______________________________________________<br>
To control your jdom-interest membership:<br>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com<br>
</font>
<br>
<br>