从以下几个方面考虑:
1) 数据库中库和表都用 utf8 编码
2) php 连接 mysql,指定数据库编码为 utf8 mysql_query("set names utf8");
3) php 文件指定头部编码为 utf-8 header("content-type:text/html;charset=utf-8 ");
4) 网站下所有文件的编码为 utf8
5) html 文件指定编码为 utf-8 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
转载请注明来源: 如何防止网页乱码出现,需要注意哪些地方? - 朱凯博客
支付宝
微信