15 个解决方案
#1
webconfig里设置一下
#2
设置globalization?可是没有用阿
#3
修改web.config中以下配置信息
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
以上只是修改整体的默认编码,如果只有某个页的编码需要修改,ASP.net 中则可以简单的使用下面代码:
Encoding gb2312 = Encoding.GetEncoding("gb2312");
Response.ContentEncoding = gb2312;
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
以上只是修改整体的默认编码,如果只有某个页的编码需要修改,ASP.net 中则可以简单的使用下面代码:
Encoding gb2312 = Encoding.GetEncoding("gb2312");
Response.ContentEncoding = gb2312;
#4
<system.web>
<globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
#5
在HTML中设置<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
文件-》高级保存-》选utf-8
文件-》高级保存-》选utf-8
#6
这些我都试过,我想要的效果是在“编码”中选择了其它编码后页面仍然选择“utf-8”编码。就像csdn的首页一样。
#7
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
或
webconfig
或
webconfig
#8
<globalization requestEncoding= "utf-8 " responseEncoding= "utf-8 " />
#9
<system.web>
<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
</system.web>
#10
设置一下
#11
这样就行了吗?
#12
+1
#13
上面说的都是一种办法,还有一个万一要是不起作用的话,就在页面的<head></head>中加入如下代码:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="pragma" content="no-cache" />
</head>
#14
<system.web>
<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
</system.web>
#15
努力学习中,谢谢分享
#1
webconfig里设置一下
#2
设置globalization?可是没有用阿
#3
修改web.config中以下配置信息
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
以上只是修改整体的默认编码,如果只有某个页的编码需要修改,ASP.net 中则可以简单的使用下面代码:
Encoding gb2312 = Encoding.GetEncoding("gb2312");
Response.ContentEncoding = gb2312;
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
以上只是修改整体的默认编码,如果只有某个页的编码需要修改,ASP.net 中则可以简单的使用下面代码:
Encoding gb2312 = Encoding.GetEncoding("gb2312");
Response.ContentEncoding = gb2312;
#4
<system.web>
<globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
#5
在HTML中设置<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
文件-》高级保存-》选utf-8
文件-》高级保存-》选utf-8
#6
这些我都试过,我想要的效果是在“编码”中选择了其它编码后页面仍然选择“utf-8”编码。就像csdn的首页一样。
#7
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
或
webconfig
或
webconfig
#8
<globalization requestEncoding= "utf-8 " responseEncoding= "utf-8 " />
#9
<system.web>
<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
</system.web>
#10
设置一下
#11
这样就行了吗?
#12
+1
#13
上面说的都是一种办法,还有一个万一要是不起作用的话,就在页面的<head></head>中加入如下代码:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="pragma" content="no-cache" />
</head>
#14
<system.web>
<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
</system.web>
#15
努力学习中,谢谢分享