I am currently using Visual Studio 2008 for my ASP .NET application. I am trying to server an excel file via the Response object. The problem is I cannot seem to set the title of the file to Japanese. If I set it to Japanese file name, it gets returned as garbage character. I am using a Japanese IE browser in a Japanese WinXP.
Response.AppendHeader("Content-Type", "application/vnd.ms-excel");
Response.AddHeader("Content-Disposition", String.Format("attachment; filename=\"{0}\"", "日本語.xls"));
OR
Response.AddHeader("Content-Disposition", String.Format("attachment; filename=\"{0}\"", Server.HtmlEncode("日本語.xls")));
I already tried to change the encoding to Shift-JIS
Response.Charset = "Shift_JIS";
or
Response.Charset = "sjis";
Any ideas? Btw, I had the same problem with Visual Studio 2005 too.