Home > php教程 > php手册 > body text

[转]结合PHP实例谈谈如何解决jQuery.ajax提交GB2312或GBK编码中

WBOY
Release: 2016-06-06 19:54:22
Original
1786 people have browsed it

http://www.biuuu.com/ 如果你的网页编码是GB2312或GBK编码,那么在使用jQuery.ajax提交中文字符时就会存在中文乱码问题,因为jQuery.ajax把需要提交的中文字符自动转换为UTF8编码,这与网页本身的GB2312或GBK编码不一致,这就会显示乱码,本文结合PHP实例,

http://www.biuuu.com/

如果你的网页编码是GB2312或GBK编码,那么在使用jQuery.ajax提交中文字符时就会存在中文乱码问题,因为jQuery.ajax把需要提交的中文字符自动转换为UTF8编码,这与网页本身的GB2312或GBK编码不一致,这就会显示乱码,本文结合PHP实例,谈谈如何解决中文乱码以及一些相关的注意事项。

实例代码如下:

(1)HTML部分(test.html)

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!