title: How do I get base 64 encoding of a file that use Windows-1251
body: <p>I have a file uploader input, where I accept a file, convert it to base 64 string, and send the payload to a rest api.</p>
  
  <p>However, when I was encoding base64 for utf-8 files, it was working fine. But if I try to get base64 strings of "window-1251" files, it is not converted to a string properly, and the api throws error instead because the base64 string is not valid content.</p>
  
  <p>So my question is how do I get base64 string of a file that uses window-1251 for encoding?</p>
  
  <pre><code>var reader2 = new FileReader();
              reader2.readAsDataURL(file);
  
              reader2.onload = function (e) {
                  var sContentStream = e.target.result;}
  </code></pre>