title: JavaScript Fetch: characters with encoding issues
body: <p>I'm trying to use Fetch to bring some data into the screen, however some of the characters ares showing a weird � sign which I believe has something to do with converting special chars.</p>
  
  <p>When debugging on the server side or if I call the servlet on my browser, the problem doesn't happen, so I believe the issue is with my JavaScript. See the code below:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var myHeaders = new Headers();
  myHeaders.append('Content-Type','text/plain; charset=UTF-8');
  
  fetch('getrastreiojadlog?cod=10082551688295', myHeaders)
          .then(function (response) {
              return response.text();
          })
          .then(function (resp) {
              console.log(resp);
          });</code></pre>
  </div>
  </div>
  </p>
  
  <p>I think it is probably some detail, but I haven't managed to find out what is happening. So any tips are welcome
  Thx</p>