【发布时间】:2011-09-05 13:31:06
【问题描述】:
我正在使用以下代码写入 CSV 文件
HttpContext context = HttpContext.Current;
context.Response.Clear();
context.Response.Write("µm");
context.Response.ContentType = "text/csv";
context.Response.AppendHeader("Content-Disposition", "attachment; filename=micron.csv");
context.Response.End();
但在 UI 中它显示为 µm 而不是 µm。我需要一点帮助。
【问题讨论】:
-
文件的编码是什么?可能是 BOM 的错。
-
哪个用户界面?您想对文件使用什么编码? UTF-8? (CSV 编码没有标准化...)
标签: c# asp.net utf-8 character-encoding c#-2.0