title: IIS 8.5 setting encoding as utf-8 for static .txt files stripping line feed
body: <p>I'm trying to set the encoding for .txt static files on the IIS 8.5 webserver.
  From what I've researched I should add this to my web.config file:</p>
  
  <pre><code>&lt;system.webServer&gt;
    &lt;staticContent&gt;
      &lt;remove fileExtension=".txt" /&gt;
      &lt;mimeMap fileExtension=".txt" mimeType="text/html; charset=utf-8"/&gt;
    &lt;/staticContent&gt;
  &lt;/system.webServer&gt;
  </code></pre>
  
  <p>While it seems to work as the page open the .txt files in Chrome as UTF-8 it seems to strip all the line feeds and I get one big block of non stop text (code).</p>
  
  <p>On the other hand I remove those lines Chrome opens the page with Windows-1252 encoding (which is a problem because extended characters in the text file which is also encoded in utf-8 don't show up). However if I manually change the encoding on the page through Chrome settings to utf-8 everything appears perfectly including the line feeds.</p>
  
  <p>What am I doing wrong, why are the line feeds being stripped when I set the encoding in the web.config file?</p>