title: How to create binary blob from atob - currently getting different bytes
body: <p>I've got a binary Excel file created on the server that I'm returning from a C# WebMethod using Convert.ToBase64String(FileData) called from a JavaScript/JQuery $ajax call. I've confirmed the base64 string data gets to the client, but when I attempt to convert it to a binary blob and save it, the bytes saved to disk aren't the same as are on the server. (I'm getting lots of 0xC3 etc. bytes, which look suspiciously like utf8 double byte injections)</p>
  
  <pre><code>$.ajax({
      type: "POST",
      contentType: "application/json;",
      dataType: "json",
      processData: false,
      data: "{ inputData: \"" + dataString + "\" }",
      url: "Api.aspx/GetExcel",
      success: ...
  </code></pre>
  
  <p>success handler code includes:</p>
  
  <pre><code>var excelBlob = new Blob([atob(msg.d)], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;' });
  ...
  var a = document.createElement('a');
  ...
  a.href = window.URL.createObjectURL(excelBlob);
  a.setAttribute('download', 'Excel.xlsx');
  </code></pre>
  
  <p>When it completes download it has bad bytes values. Binary comparison with source shows it's close but has C3 and similar values inserted or munged into place.</p>
  
  <p>Is there something I'm doing wrong or missing to get my Base64 string correctly converted to a client binary blob? </p>