context.Response.Charset = Encoding.UTF8.ToString(); [英] context.Response.Charset = Encoding.UTF8.ToString();

查看:2333
本文介绍了context.Response.Charset = Encoding.UTF8.ToString();的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的code使用该设置字符集,但IE不喜欢它。什么理由?

context.Response.Charset = Encoding.UTF8.ToString();

我最后不得不将其设置为只context.Response.ContentType =应用/ JSON的;字符集= UTF-8或context.Response.Charset =UTF-8;代替。不知道又是什么Encoding.UTF8.ToString();将用于IE,如果不能把它


解决方案

  Context.Response.Charset = Encoding.UTF8.WebName;

获取与互联网编号分配机构(IANA)当前编码注册的名称。

I had used this in my code to set the Charset but IE did not like it. Any reason why?

context.Response.Charset = Encoding.UTF8.ToString();

I ended up having to set it to just context.Response.ContentType = "application/json;charset=utf-8" or context.Response.Charset = "utf-8"; instead. Not sure then what Encoding.UTF8.ToString(); would be utilized for if IE can't take it

解决方案

Context.Response.Charset = Encoding.UTF8.WebName;

Gets the name registered with the Internet Assigned Numbers Authority (IANA) for the current encoding.

这篇关于context.Response.Charset = Encoding.UTF8.ToString();的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆