title: Invalid character error while using atob() method
body: <p>I have read a question in stack overflow with this code work in IE 10 but not work in  ie9,</p>
  
  <p>but still i am facing issue on this.</p>
  
  <pre><code>var image = canvas.toDataURL();
  image = image.replace(/^data:[a-z]*;,/, '');
  var byteString = atob(image);
  var buffer = new ArrayBuffer(byteString.length);
  var intArray = new Uint8Array(buffer);
  for (var i = 0; i &lt; byteString.length; i++) {
      intArray[i] = byteString.charCodeAt(i);
  }
  blob = new Blob([buffer], {type: "image/png"});
  window.navigator.msSaveOrOpenBlob(blob, "test.png");
  </code></pre>
  
  <p>while converting atob(image) it throw an exception
  0x800a139e - JavaScript runtime error: InvalidCharacterError
  i tried several things but nothing works...</p>
  
  <p>i got this in image variable</p>
  
  <p>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcIAAAGQCAYAAAA9XmC5AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABJFSURBVHhe7dvPa5x3fsDxeaR0l3UO9dLuSnJLE3rpzc6pp0KUQ2MLL8Xk1BZWt+7BhmKaGYctfKR3ng8vjyZTE6W5St98PZnF9ZO/NeZsiyWt0+c//RUWQBHxIkQjlBGsEx7Eb/7ZbqQF23zz22vvf+L6+f/Um4BQDeNRqPtvMoy194TQsc5EcIRatv2SZnmY9L1HOOUuDPdADpJCOEIRfQex7BaviCzkXsRxwc5At3kyzJwxMoXZmZfdLnZ7/c3yxwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvkF6vf8DAs32KwowBEUAAAAASUVORK5CYII=
  please help me..
  Thanks in advance..</p>