title: Downloading binary data using XMLHttpRequest, without overrideMimeType
body: <p>I am trying to retrieve the data of an image in Javascript using <code>XMLHttpRequest</code>.</p>
  
  <pre><code>var xhr = new XMLHttpRequest();
  xhr.open("GET", "http://www.celticfc.net/images/doc/celticcrest.png");
  xhr.onreadystatechange = function() {
      if (xhr.readyState === 4) {
          var resp = xhr.responseText;
          console.log(resp.charCodeAt(0) &amp; 0xff);
      }
  };
  xhr.send();
  </code></pre>
  
  <p>The first byte of this data should be <code>0x89</code>, however any high-value bytes return as <code>0xfffd</code> (<code>0xfffd &amp; 0xff</code> being <code>0xfd</code>).</p>
  
  <p>Questions such as <a href="https://stackoverflow.com/questions/1095102/how-do-i-load-binary-image-data-using-javascript-and-xmlhttprequest">this one</a> offer solutions using the <code>overrideMimeType()</code> function, however this is not supported on the platform I am using (Qt/QML).</p>
  
  <p>How can I download the data correctly?</p>