网站页面汉字乱码解决方案

来源:互联网 发布:centos 7配置lamp环境 编辑:程序博客网 时间:2024/05/16 08:26

 网站页面出现乱码,怎么办?

 

在webconfig中的 <system.web></system.web>配置节中指定以utf-8方式编码,配置如下:

<system.web>

<globalization requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="utf-8" responseHeaderEncoding="utf-8"/>

</system.web>

 

页面传递汉字的时候,别忘记了用[Js]encodeURIComponent编码汉字[CS:Server.UrlEncode]。

 

keyword:页面汉字乱码