Asp.net 在CSV中替换丹麦字符
创建包含丹麦字符的CSV文件的代码Asp.net 在CSV中替换丹麦字符,asp.net,utf-8,character-encoding,Asp.net,Utf 8,Character Encoding,创建包含丹麦字符的CSV文件的代码 Response.ClearContent(); Response.AddHeader("content-disposition", attachment); Response.ContentType = "application/csv;charset=utf-8"; Response.Charset = "utf-8"; Response.Write(sb.ToString()); Respons
Response.ClearContent();
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/csv;charset=utf-8";
Response.Charset = "utf-8";
Response.Write(sb.ToString());
Response.End();
不知道为什么,但是当结果CSV被创建时,丹麦字符被替换为一些特殊字符,如
?j
。有人能给我一些线索吗?是StringBuilder UTF-8中的源文本吗?如果不是这样的话,.NET就有可能被弄糊涂,并写出错误的字符。如果不在UTF-8中,请在写入客户端之前尝试运行