None
None

Reputation: 5670

Danish characters are replaced in CSV

My code to create a CSV file that contains Danish characters

     Response.ClearContent();
     Response.AddHeader("content-disposition", attachment);
     Response.ContentType = "application/csv;charset=utf-8";
     Response.Charset = "utf-8";
     Response.Write(sb.ToString());
     Response.End();

Don't know why but when result CSV is created danish characters are replaced with some special characters like ??j.Can any one give me any clue?

Upvotes: 0

Views: 458

Answers (1)

Smetad Anarkist
Smetad Anarkist

Reputation: 898

Is the source text in the StringBuilder UTF-8? If not there is a chance that .NET gets confused and writes the wrong characters. If it isn't in UTF-8 try running Encoding.Convert before writing to the client.

Upvotes: 1

Related Questions