title: ASP MVC3 FileResult with accents + IE8 - bugged?
body: <p>If the file name contains accents, it works as expected in Opera, FF, Chrome and IE9.</p>
  
  <p>But in IE8 file type is "unknown file type", and shows "file" as the file name (actually the last part of the URL).</p>
  
  <p>Does anyone know a workaround? Other than replacing the "special" characters in the file name?</p>
  
  <p>The test code: (file | new project | add controller)</p>
  
  <pre><code>public class FileController : Controller
  {
      public ActionResult Index(bool? Accents)
      {
          byte[] content = new byte[] { 1, 2, 3, 4 };
  
          return File(content, "application/octet-stream", true.Equals(Accents) ? "dsaé.txt" : "dsae.txt");
      }
  }
  </code></pre>
  
  <p>test it like this:
  <a href="http://localhost/file" rel="nofollow">http://localhost/file</a>, and
  <a href="http://localhost/file?accents=true" rel="nofollow">http://localhost/file?accents=true</a></p>
  
  <h2>Edit => The "solution" for me, if anyone interested:</h2>
  
  <pre><code>public class FileContentResultStupidIE : FileContentResult //yeah, maybe i am not totally "politically correct", but still...
  {
      public FileContentResultStupidIE(byte[] fileContents, string contentType) : base(fileContents, contentType) { }
  
      public override void ExecuteResult(ControllerContext context)
      {
          var b = context.HttpContext.Request.Browser;
          if (b != null &amp;&amp; b.Browser.Equals("ie", StringComparison.OrdinalIgnoreCase) &amp;&amp; b.MajorVersion &lt;= 8)
          {
              context.HttpContext.Response.AppendHeader("Content-Disposition", "attachment; filename=\"" + HttpUtility.UrlPathEncode(base.FileDownloadName) + "\"");
              WriteFile(context.HttpContext.Response);
          }
          else
          {
              base.ExecuteResult(context);
          }
      }
  }
  </code></pre>