Hi,
from the data in my asp.net application i want to generate a excel file for the user to download. I generate it first using a stringbuilder sb, and then use the following code to stream a xls file to the user.
All works fine, but if the user types in special characters like ö, ô, ä, etc, they appear like sth like this: öò
In the stringbuilder that i use, the characters are still in the correct form. So the problem must lie in this piece of code: (response is a object of type System.Web.HttpResponse)
response.Clear();
response.ContentType = "application/vnd.ms-excel"
;
response.Charset = "";
response.AppendHeader("Con
tent-dispo
sition", String.Format("attachment;
filename={0}", FileName));
response.Write(sb.ToString
());
response.Flush();
response.End();
I tried using
response.Charset = "utf-8";
or
response.ContentType = "application/vnd.ms-excel;
charset=UT
F-8";
but that didnt help. How can i get the UTF-8 characters in excel?
Start Free Trial