title: Does 'fetch' method present the same functionality as 'FileReader'?
body: <p>I managed to read the text file byte by byte and to change the charset from windows-1251 to Unicode for a file loaded from the end user's computer via an <code>input</code> element and <code>FileReader</code>. Now I want to do the same thing for a file from my server, via <code>fetch</code>. Is it possible to do that? (The <code>fetch</code> would be in a page served via HTTP and the URL would be relative, e.g. <code>fetch("raw/graph_tab.txt")</code>&nbsp;&mdash; I'm not trying to read a file directly from the end user's machine as I was with an <code>input</code> field and <code>FileReader</code>).</p>
  
  <p>Chunks of working code (<a href="https://github.com/mathiasbynens/windows-1251" rel="noreferrer">'windows-1251.js'</a> library is created by Mathias Bynens):</p>
  
  <pre><code>&lt;input type="file" id="file"/&gt;
  &lt;script type="text/javascript"&gt;
          document.getElementById("file").addEventListener("change", readFile, false);
  
          function readFile (evt) {
              var files = evt.target.files;
              var file = files[0];           
              var reader = new FileReader();
              reader.onload = function(event) {
                  console.log(windows1251.decode(event.target.result));            
              }};
  </code></pre>