最近在开发的时候导出Excel,当数据量大时,没有什么问题,当数量很小时经常会出现导出内容乱码问题。
起始只要在输出的地方加一句
const string _addHeader = "<meta http-equiv=\"content-type\" content=\"application/ms-excel; charset=UTF-8\"/>";
_curContext.Response.Write(_addHeader+strWriter);
就OK了
最近在开发的时候导出Excel,当数据量大时,没有什么问题,当数量很小时经常会出现导出内容乱码问题。
起始只要在输出的地方加一句
const string _addHeader = "<meta http-equiv=\"content-type\" content=\"application/ms-excel; charset=UTF-8\"/>";
_curContext.Response.Write(_addHeader+strWriter);
就OK了
转载于:https://www.cnblogs.com/zhenhunfan/archive/2012/12/06/2805576.html