Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think the "leading hex character" is a byte order mark (BOM) as I commented on your question, though I can't be sure without actually seeing it. The C++ parser seems not to know about BOMs, which is odd (see <a href="http://www.joelonsoftware.com/articles/Unicode.html" rel="nofollow">standard reference by Joel Spolsky</a>).</p> <p>Let's assume that the C++ parser works only with XML encoded as UTF-8 or one of its character subsets (ASCII, ISO-8859-1, etc.). In that case you have no option but to encode as UTF-8 but exclude the BOM. <code>XmlWriter</code> lets you do so as follows:</p> <pre><code>var utf8NoBom = new UTF8Encoding(false); var writer = XmlWriter.Create(fs, new XmlWriterSettings() { Encoding = utf8NoBom } ); </code></pre> <p>The quote below is from the MSDN reference on <a href="http://msdn.microsoft.com/en-us/library/ms162617%28v=vs.110%29.aspx" rel="nofollow">XmlWriter.Create</a>:</p> <blockquote> <p>XmlWriter always writes a Byte Order Mark (BOM) to the underlying data stream; however, some streams must not have a BOM. To omit the BOM, create a new XmlWriterSettings object and set the Encoding property to be a new UTF8Encoding object with the Boolean value in the constructor set to false.</p> </blockquote> <p>EDIT: If the C++ parser is a general-purpose XML parser then its ignorance of BOMs is odd. If the parser is domain-specific, i.e. if it is always used with files whose character encoding is known (and obviously limited), then its ignorance is not odd. I think this is Spolsky's point.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload