mysql_query ("Set names ' UTF8 '");
I've already written this, but it's still like this.
MySQL database is also UTF8
Reply to discussion (solution)
Json_encode default is the HTML entity that converts Chinese into Unicode.
If your PHP version is greater than or equal to 5.4.0, you can
$s = ' Chinese '; Echo json_encode ($s, json_unescaped_unicode);
Chinese
Json_encode default is the HTML entity that converts Chinese into Unicode.
If your PHP version is greater than or equal to 5.4.0, you can
$s = ' Chinese '; Echo json_encode ($s, json_unescaped_unicode);
Chinese
My version is 5.2.6 how to do.
The system is Mac:
Well, that could happen.
$a = Array (' Chinese ', Aray (' Chinese ')); Echo Preg_replace_callback ('/\\\u (. { 4})/', ' foo ', Json_encode ($a)), function foo ($m) { return iconv (' ucs-2 ', ' Utf-8 ', pack (' h* ', $m [1]);}
["Chinese", ["Chinese"]]