Home > Database > Mysql Tutorial > MySQL的中文UTF8乱码问题

MySQL的中文UTF8乱码问题

WBOY
Release: 2016-06-07 18:02:18
Original
862 people have browsed it

MySQL从4.x版本开始支持Unicode,3.x只有latin1编码。刚工作的时候就开始用MySQL了,用的php存取,网页xxx.php是gb2312的编码,存进去的数据用php取出来是中文,用phpMyAdmin执行select、update、dump都是中文,没有乱码问题。

从MySQL支持Unicode后,为了与时俱进,我们的web程序也开始考虑用UTF8了。其实UTF8也用了好几年了,程序基本能跑,没什么大问题,但是数据倒换的时候,总是遇到不爽的事情。

【问题现象】

网页xxx.php用EditPlus另存为UTF8格式,MySQL在my.ini里设置default-character-set=utf8,建表时加了

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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template