title: ASP.NET MVC: how to set encoding when returning FileResult
body: <p>In my controller, I have the following to send HTML snippet stored in CSHTML files to the front. </p>
  
  <pre><code>    public FileResult htmlSnippet(string fileName)
      {
          string contentType = "text/html";
          return new FilePathResult(fileName, contentType);
      }
  </code></pre>
  
  <p>The fileName looks like the following:</p>
  
  <p>/file/abc.cshtml</p>
  
  <p>What troubles me now is that these HTML snippet files have Spanish characters and they don't look right when they are displayed in pages.</p>
  
  <p>Thanks and regards.</p>