//asp.net
有时我们已经在配置文件中将整个站点的编码设置为gb2312,但某个页面却需要使用utf-8,这时我们可以在配置文件configuration节下新增location节点:
程序代码
<location path="Test.aspx">
<system.web>
<globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="en"/>
</system.web>
</location>
如果是要将某个页面单独设置为gb2312则为:
程序代码<location path="Test.aspx">
<system.web>
<globalization fileEncoding="gb2312" requestEncoding="gb2312" responseEncoding="gb2312" culture="zh-CN"/>
</system.web>
</location>
![](https://img2024.cnblogs.com/blog/35695/202408/35695-20240826070647288-243310440.jpg)