<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Tahoma">
<DIV>Hello <SPAN class=873102612-30062005>Jacques,</SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV>Thank you for your kind answer. I have found the reason of this ill-formed utf-8 char :<BR>The wrong "A0" code was output directly from the text input file to the XML file, the other "A0" codes were transfered to utf-8 conversion routines. That's why this&nbsp;one wasn't well coded in UTF8 and the others were correct.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thank you very much for your help.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Best regards.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Luc</DIV>
<DIV>&nbsp;</DIV>
<DIV>The question is : why does this first one code "C2 A0" works fine, and not the next one ?</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>&gt;&gt;&gt; Jacques.DESEYNE@swift.com 30/06/2005 14:52:24 &gt;&gt;&gt;<BR></DIV>
<DIV style="FONT: 10pt Tahoma; COLOR: #000000">
<DIV dir=ltr align=left><SPAN class=873102612-30062005>Luc,</SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=873102612-30062005></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=873102612-30062005>Bytes are not the same things as characters!&nbsp;There exist several conventions ("encodings") for representing characters by a&nbsp;byte sequence.&nbsp;XML has the&nbsp;Unicode character set (there are quite a lot of characters in it, see the code charts at <A href="http://www.unicode.org">http://www.unicode.org</A>) and their default encoding is&nbsp;UTF-8, but other encodings can be used as well.</SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=873102612-30062005></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=873102612-30062005>In an UTF-8 encoding, only characters under 127 (0x7F) are represented by a single byte. The non-breaking space&nbsp;character '0xA0' is represented by the byte sequence 'C2 A0'. Your sample document has some of these, for instance within the &lt;Auteur&gt; tag for &lt;Ouvrage&gt; where &lt;Nuart&gt; contains "9610767":</SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=873102612-30062005></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=873102612-30062005>...<BR>000001b0&nbsp;&nbsp; 3c 2f 54 69 74 72 65 3e 3c 41 75 74 65 75 72 3e&nbsp;&nbsp; &lt;/Titre&gt;&lt;Auteur&gt;</SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=873102612-30062005>000001c0&nbsp;&nbsp; c2 a0 3c 2f 41 75 74 65 75 72 3e 3c 50 72 69 78&nbsp;&nbsp; ..&lt;/Auteur&gt;&lt;Prix<BR>...</SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=873102612-30062005>Where you see the dodgy&nbsp;'A0' byte (at&nbsp;file offset 0x00001140, if I'm not mistaken), you should have 'C2 A0', i.e. two bytes instead of one. You may&nbsp;need to check how these data are generated.</SPAN></DIV>
<DIV><SPAN class=873102612-30062005></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=873102612-30062005>Look&nbsp;for an explanation on UTF-8&nbsp;(and other) encodings on the Web&nbsp;-- you will see that there's more about it than one might have expected.</SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=873102612-30062005></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=873102612-30062005>Best regards,</SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=873102612-30062005>--</SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=873102612-30062005>Jacques Deseyne</SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=873102612-30062005></SPAN>&nbsp;</DIV><BR>
<BLOCKQUOTE dir=ltr style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<B>From:</B> owner-xep-support@renderx.com [mailto:owner-xep-support@renderx.com] <B>On Behalf Of </B>LUC AUDRAIN<BR><B>Sent:</B> Thursday, June 30, 2005 11:58 AM<BR><B>To:</B> msulyaev@renderx.com; xep-support@renderx.com<BR><B>Subject:</B> Rép. : Re: [xep-support] Invalid UTF-8 byte<BR><BR></DIV>
<DIV></DIV>
<DIV>Hello Michael,</DIV>
<DIV>&nbsp;</DIV>
<DIV>I Think that it is an 0A I have after the xml declaration, as I have at the end of each line of this file. The invalid UTF-8 byte is a0xA0.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Looking a bit more precisely, I have found this 'A0' byte : it is in the ligne beginning with "&lt;Nuart&gt;4776027" inside the element Run.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Now, I still don't understand why it is an invalid UTF-8 byte, because when I open this file in UltraEdit in Hex mode I see "00A0" and "00A0" is a valid Unicode character! I may filter it here, but in some case, I may need it as it is the "NO-BREAK SPACE".</DIV>
<DIV>&nbsp;</DIV>
<DIV>What's wrong.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Best regards</DIV>
<DIV>&nbsp;</DIV>
<DIV>Luc AUDRAIN<BR>__________________________________<BR>DSI / Infocube<BR>Informatique Éditoriale<BR>HACHETTE LIVRE<BR>43, quai de Grenelle<BR>75015 PARIS<BR>00 33 1 43 92 38 12<BR><A href="mailto:laudrain@hachette-livre.fr">laudrain@hachette-livre.fr</A><BR><BR>&gt;&gt;&gt; msulyaev@renderx.com 24/06/2005 17:28:42 &gt;&gt;&gt;<BR>Hello, Luc,<BR><BR>Your .xml file is invalid: it has a 0xA0 byte after the xml declaration <BR>and before anything else, e.g. like here (the last byte shown):<BR><BR>3C 3F 78 6D 6C 20 76 65 ¦ 72 73 69 6F 6E 3D 22 31 &lt;?xml version="1<BR>2E 30 22 20 65 6E 63 6F ¦ 64 69 6E 67 3D 22 55 54 .0" encoding="UT<BR>46 2D 38 22 3F 3E 20 20 ¦ 20 20 20 20 20 20 20 20 F-8"?&gt;<BR>20 20 20 20 20 20 20 20 ¦ 20 20 20 20 20 20 20 20<BR>A0 &lt;<BR><BR>Use any HEX editor to fix.<BR><BR>-- <BR>Best regards,<BR>Michael Sulyaev<U> <A href="mailto:msulyaev@renderx.com">mailto:msulyaev@renderx.com</A></U> <BR>RenderX.<BR><BR><BR><BR>LUC AUDRAIN wrote:<BR>&gt; Hello,<BR>&gt; <BR>&gt; On some XML files, I have an error message on validation :<BR>&gt; <BR>&gt; [error] Error reported by XML parser; SystemID: file:/J:/Traitement <BR>&gt; BdC/Depot TXT/lg/OPERATION ARTEMIS CHASSE 23 AOUT 2005.xml; Line#: -1; <BR>&gt; Column#: 949<BR>&gt; [error] javax.xml.transform.TransformerException: Error reported by XML <BR>&gt; parser error: formatting failed: <BR>&gt; javax.xml.transform.TransformerException: org.xml.sax.SAXParseException: <BR>&gt; invalid UTF-8 byte (check the XML declaration) (code: 0xa0)<BR>&gt; <BR>&gt; I found information on the Renderx Web Site in this answer<BR>&gt; *From*: Mike Trotman &lt;<U> <A href="mailto:mike.trotman@datalucid.com">mike.trotman@datalucid.com</A></U> <BR>&gt; &lt;<U> <A href="mailto:mike.trotman@datalucid.com?Subject=Re:%20[xep-support]%20UTF%20data%20format">mailto:mike.trotman@datalucid.com?Subject=Re:%20[xep-support]%20UTF%20data%20format</A></U> &gt;&gt; <BR>&gt; <BR>&gt; *Date*: Mon May 02 2005 - 08:14:51 PDT<BR>&gt; and tried without success.<BR>&gt; <BR>&gt; The workaround I found is to save the XML file again from any text or <BR>&gt; xml editor (as XMLSPy) and it works fine.<BR>&gt; <BR>&gt; In order to find what's wrong in my source file, I'd like to know how to <BR>&gt; use the ligne and column information in the error message : Line#: -1; <BR>&gt; Column#: 949.<BR>&gt; <BR>&gt; Best regards.<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; Luc AUDRAIN<BR>&gt; __________________________________<BR>&gt; DSI / Infocube<BR>&gt; Informatique Éditoriale<BR>&gt; HACHETTE LIVRE<BR>&gt; 43, quai de Grenelle<BR>&gt; 75015 PARIS<BR>&gt; 00 33 1 43 92 38 12<BR>&gt; <U><A href="mailto:laudrain@hachette-livre.fr">laudrain@hachette-livre.fr</A></U> &lt;<U> <A href="mailto:laudrain@hachette-livre.fr">mailto:laudrain@hachette-livre.fr</A></U> &gt;<BR>&gt; <BR>-------------------<BR>(*) To unsubscribe, send a message with words 'unsubscribe xep-support'<BR>in the body of the message to <U><A href="mailto:majordomo@renderx.com">majordomo@renderx.com</A></U> from the address<BR>you are subscribed from.<BR>(*) By using the Service, you expressly agree to these Terms of Service <U><A href="http://www.renderx.com/terms-of-service.html">http://www.renderx.com/terms-of-service.html</A></U> <BR></DIV></BLOCKQUOTE></DIV></BODY></HTML>