show variables like '%char%'; set character_set_client='utf8'; set character_set_connection='utf8'; set character_set_results='utf8'; set character_set_database='utf8';
Linux version 2.6.32-431.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) #1 SMP Fri Nov 22 03:15:09 UTC 2013
android没有问题
手机换了两个试了
PHP输出是中文乱码
添加了header("Content-Type:text/html; charset=utf-8");这个也没有效果
[root@VM_106_230_centos ~]# rpm -qa |grep httpd
httpd-2.4.12-1.el6.x86_64
是 apache
我的代码如下:
Page({
data: {
// threads: [],
},
onLoad: function () {
var that = this;
wx.request({
url: 'https://www.ybhtest.club/1.php',
header: {
// "content-type": "applciation/json",
// "charset": "utf-8"
},
method: "GET",
success: function (res) {
console.log(res.data);
that.setData({
threads: res.data
//threads: { "state": 10000, "datas": [{ "id": 21, "title": "Excel教程系列之数据透视表与数据透视图", "time": "2017-07-04" }, { "id": 12, "title": "上传图片试试", "time": "2017-06-27" }, { "id": 11, "title": "Excel教程系列之公式篇(SUMIF函数)", "time": "2017-06-27" }, { "id": 7, "title": "电脑小白的成长晋级之路 - 组装篇", "time": "2017-06-27" }, { "id": 6, "title": "Excel教程系列之公式篇(IF函数嵌套)", "time": "2017-06-27" }, { "id": 5, "title": "Excel教程系列之公式篇(VLOOKUP函数)", "time": "2017-06-27" }, { "id": 4, "title": "Excel教程系列之技巧篇(合并和分列)", "time": "2017-06-27" }, { "id": 3, "title": "Excel教程系列之技巧篇(打勾)", "time": "2017-06-27" }, { "id": 2, "title": "使用XT800远程控制的操作", "time": "2017-06-27" }, { "id": 1, "title": "Excel教程系列之技巧篇(通配符)", "time": "2017-06-27" }] }
})
},
fail: function (err) { console.log(err) },
complete: function () { }
})
}
})
显示都是中文正常,真机就是中文乱码
当我把返回页面内容直接使用返回的数据代替,浏览器显示乱码,奇迹却发生了,测试环境和真机环境里面的中文却正常了??这是什么鬼
show variables like '%char%';
set character_set_client='utf8';
set character_set_connection='utf8';
set character_set_results='utf8';
set character_set_database='utf8';
修改之后,重启之后又会出现图片那种
[root@VM_106_230_centos ~]# mysql -V
MYSQL的版本如下:
mysql Ver 14.14 Distrib 5.6.26, for Linux (x86_64) using EditLine wrapper
返回的中文也是正常没有乱码,就是手机预览就是乱码,我真是醉了
cat /proc/version
显示的Linux版本如下:
Linux version 2.6.32-431.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) #1 SMP Fri Nov 22 03:15:09 UTC 2013
嗯,是utf8格式
开发环境里面中文没有乱码
自己打的中文字在开发环境和真实环境都是OK的,就是服务器返回的中文在真实环境就乱码