title: UTF-8 string not decoded correctly in AngularJS
body: <p>I have a text input box, within a SPA built on AngularJS, for users to add a title to a printout.  The input box is declared like this:</p>
  
  <pre><code>&lt;input class="chart-title" type="text" ng-model="chartTitle" ng-change="titleChanged()"/&gt;
  </code></pre>
  
  <p>The text box is filled with a default title provided by the server.  A user may change the title to whatever suits them.  When the title is changed, the server is updated and sends back a new title in the header of the response which then replaces the title in the box.  This works perfectly for standard ASCII type characters.</p>
  
  <p>However, for unicode characters (for example àßéçøö) it does not work. The text is sent down correctly, updated on the server correctly, and returned to the SPA correctly.  The headers for the request/response are here:</p>
  
  <pre><code>Request URL:http://blahblahblah/api/.....&amp;chartTitle=Instrument:%20%C3%A0%C3%9F%C3%A9%C3%A7%C3%B8%C3%B6
  </code></pre>
  
  <p>Response Headers:</p>
  
  <pre><code>chartTitle: Instrument: %C3%A0%C3%9F%C3%A9%C3%A7%C3%B8%C3%B6
  </code></pre>
  
  <p>The request is made using AngularJS <code>$http()</code>. As you can see the values match up (the space in the request codes out as <code>%20</code> for obvious reasons).  However, when I retrieve the header, using <code>headers("charttitle")</code>, the value I receive is <code>Instrument: Ã ÃÃ©Ã§Ã¸Ã¶</code></p>
  
  <p>The javascript bundle is declared in the index with charset utf-8:</p>
  
  <pre><code>&lt;script src="/js/bundle.js" type="text/javascript" charset="UTF-8"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>In addition the html is declared with the correct charset, it seems to me in two places within the head declaration:</p>
  
  <pre><code>&lt;meta http-equiv="Content-Type" content="text/html charset=UTF-8" /&gt;
  &lt;meta charset="utf-8" /&gt;
  </code></pre>
  
  <p>According to this website (<a href="http://www.i18nqa.com/debug/utf8-debug.html">http://www.i18nqa.com/debug/utf8-debug.html</a>) it appears that I am getting Windows1252 character encoding.  This does not make any sense.  I could, if absolutely necessary, write a horrible hack converting the utf-8 string to Windows1252 characters, but this seems a little extreme and quite error prone to me.</p>
  
  <p>The effect is the same, whether on Chrome, Firefox or IE11.  The full request headers are here:</p>
  
  <pre><code>Accept:application/json, text/plain, */*
  Accept-Encoding:gzip, deflate, sdch, br
  Accept-Language:en-GB,en-US;q=0.8,en;q=0.6
  Connection:keep-alive
  Host:blahblahblah
  Origin:http://blahblahblah
  Referer:http://blahblahblah/
  User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
  </code></pre>
  
  <p>Is there anything I have left out?  Anything that has been forgotten?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p><em>Full response headers as requested.</em></p>
  
  <pre><code>Access-Control-Allow-Origin:*
  Access-Control-Expose-Headers:chartTitle
  Cache-Control:private
  chartTitle:Instrument: %C3%A0%C3%9F%C3%A9%C3%A7%C3%B8%C3%B6
  Content-Disposition:attachment; filename=PrintData.pdf
  Content-Length:1391643
  Content-Type:application/octet-stream
  Date:Fri, 20 Jan 2017 11:19:07 GMT
  Server:Microsoft-IIS/10.0
  X-AspNet-Version:4.0.30319
  X-Powered-By:ASP.NET
  X-SourceFiles:=?UTF-8?B?QzpcR2l0XEVPU1xSZXZpZXdlci5XZWJcYXBpXFByaW50XGQyOTNkNjA4NWVlYzlhNTEwYjQ5YThmZGQxNjNhMjAwMWZhYTFjMGY5YzhiMzUxYzE5ZjYxYWMwYTY1OWVhMDM=?=
  </code></pre>
  
  <p><em>Code around the <code>headers</code></em></p>
  
  <pre><code>$http({
      method: 'GET',
      url: filePath,
      params: {
          fileName: fileName
      },
      responseType: 'arraybuffer',
      headers: {'Content-Type' : 'application/json; charset=UTF-8'}
  }).success(function (data, status, headers) {
      ready();
      if (status == 200) {
          var chartTitle = headers("charttitle");
          var printoutInformation = {'chartTitle' : chartTitle, 'pdfData' : data};
          deferred.resolve(printoutInformation);
      }
      else {
          deferred.resolve(null);
      }
      }).error(function (data) {
          ready();
          console.log(data);
      });
      return deferred.promise;
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>The <code>web.config</code> for the api also specifies utf-8:</p>
  
  <pre><code>    &lt;globalization requestEncoding="utf-8" responseEncoding="utf-8"/&gt;
  </code></pre>
  
  <p><strong>TL;DR</strong></p>
  
  <p>In a text box I want to display "Instrument àßéçøö" and instead I am seeing "Instrument: Ã ÃÃ©Ã§Ã¸Ã¶"</p>