title: Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.
body: <p>The error in the title is thrown only in Google Chrome, according to my tests. I'm base64 encoding a big XML file so that it can be downloaded:</p>
  
  <pre><code>this.loader.src = "data:application/x-forcedownload;base64,"+
                    btoa("&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;"
                    +"&lt;"+this.gamesave.tagName+"&gt;"
                    +this.xml.firstChild.innerHTML
                    +"&lt;/"+this.gamesave.tagName+"&gt;");
  </code></pre>
  
  <p><code>this.loader</code> is hidden iframe.</p>
  
  <p>This error is actually quite a change because normally, Google Chrome would crash upon <code>btoa</code> call. Mozilla Firefox has no problems here, so the issue is browser related.
  I'm not aware of any strange characters in file. Actually I do believe there are no non-ascii characters.</p>
  
  <p><strong>Q:</strong>
  How do I find the problematic characters and replace them so that Chrome stops complaining?</p>
  
  <p><sub>I have tried to use Downloadify to initiate the download, but it does not work. It's unreliable and throws no errors to allow debug.</sub></p>