How to HTML encode a csv export
<p>I get</p>

<pre><code> QuattrodeÂ® 
</code></pre>

<p>From a string that is HTML encoded as </p>

<pre><code>Quattrode® 
</code></pre>

<p>when viewing inside Excel 2007.  </p>

<p><strong>Routine</strong></p>

<pre><code>        Response.Clear();
        Response.Buffer = true;

        Response.ContentType = "text/comma-separated-values";
        Response.AddHeader("Content-Disposition", "attachment;filename=\"Expired.csv\"");

        Response.RedirectLocation = "export.csv";

        Response.Charset = "";
        //Response.Charset = "UTF-8";//this does not work either.
        EnableViewState = false;

        ExportUtility util = new ExportUtility();

        Response.Write(util.DataGridToCSV(gridViewExport, ","));
</code></pre>

<p>Basically <code>DataGridToCSV()</code> uses  <code>HttpUtility.HtmlDecode(stringBuilder.ToString());</code> and I can use visual studio's text visualizer and see the string looks correct (Quattrode®). </p>

<p>So something in the <code>Response</code> procedure or in Excel's interpretation of the file is not correct. Any idea how to fix?</p>

<p><hr />
<strong>UPDATE</strong><br />
Turns out that this is not interpreted properly in Excel or WordPad.  I open it up in Notepad and the symbol shows up properly.</p>
