如何设置 编码格式 使生成的csv文件 是 utf8 带 BOM的 代码附上
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"))