title: Encoding for an XML document containing U+001A
body: <p>I have an XML document that's being generated from some content that people are copy/pasting from all sorts of places (Word documents mostly though).</p>
  
  <p>It looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;response&gt;
      &lt;data&gt; &lt;![CDATA[
           (whatever was pasted)
      ]]&gt;&lt;/data&gt;        
  &lt;/response&gt;
  </code></pre>
  
  <p>I've always used an encoding of <code>UTF-8</code> or <code>iso-8859-1</code>, but now someone's gone and copy/pasted the unicode character <a href="http://www.fileformat.info/info/unicode/char/1a/index.htm" rel="nofollow"><code>U+001A</code></a> (<code>0x1a</code>) and I can't find an encoding that will accept it. Everything I put the XML file into (e.g. Firefox, Internet Explorer, XML Spy) all say it's invalid, regardless of the kind of encoding used.</p>
  
  <p>Is there an encoding I can use that will stop the file from falling over, or do I need to start stripping all these characters out one by one?</p>