I get
Quattrode®
From a string that is HTML encoded as
Quattrode®
when viewing inside Excel 2007.
Routine
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, ","));
Basically DataGridToCSV()
uses HttpUtility.HtmlDecode(stringBuilder.ToString());
and I can use visual studio's text visualizer and see the string looks correct (Quattrode®).
So something in the Response
procedure or in Excel's interpretation of the file is not correct. Any idea how to fix?
UPDATE
Turns out that this is not interpreted properly in Excel or WordPad. I open it up in Notepad and the symbol shows up properly.