C#导出为excel 汉字为乱码

C#导出为excel 汉字为乱码
2025-03-01 23:22:35
推荐回答(2个)
回答1:

Response.Charset = "utf-8";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
上面两句是设置文字编码的

回答2:

StreamWriter writer = new StreamWriter(this.filepath, false, Encoding.Default);