.net网站用gb2312输出中文乱码的解决办法
网站已经设置utf-8作为全局编码,某个页面的后台需要采用gb2312输出中文,发现用Response.ContentType = "text/html;charset=GB2312"没效果,输出是一堆乱码。
需要这样才行:
Response.ContentEncoding = Encoding.GetEncoding("GB2312");
网站已经设置utf-8作为全局编码,某个页面的后台需要采用gb2312输出中文,发现用Response.ContentType = "text/html;charset=GB2312"没效果,输出是一堆乱码。
需要这样才行:
Response.ContentEncoding = Encoding.GetEncoding("GB2312");