form导出excel出现乱码问题

form导出excel出现乱码问题,是有没有添加meta信息造成的。
添加
<meta http-equiv="content-type" content="application/vnd.ms-excel; charset=utf-8"/>

控制输出页面内容的编码方式,则没有乱码了。

示例代码:

var st = "<meta http-equiv="content-type" content="application/vnd.ms-excel; charset=utf-8"/>";
System.Web.HttpContext.Current.Response.Output.Write(st + ExcelContent);

  

原文地址:https://www.cnblogs.com/363546828/p/9244308.html