如何设置 编码格式 使生成的csv文件 是 utf8 带 BOM的 代码附上

wojiaonimabi wojiaonimabi 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.Buffer = False
HttpContext.Current.Response.AddHeader("Connection", "Keep-Alive")
HttpContext.Current.Response.AddHeader("Content-Transfer-Encoding", "binary")
HttpContext.Current.Response.ContentType = "application/octet-stream;charset=UTF-8"
HttpContext.Current.Response.Charset = "UTF-8"
'HttpContext.Current.Response.HeaderEncoding = Encoding.GetEncoding("Shift-JIS")
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8
' HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("goods.csv"))
...全文
评论 2
收藏 已收藏
分享
返回顶部
wojiaonimabi
VB 16,718 成员 110,520 内容