Although the latest PHP 5.4 has good support for JSON Chinese encoding, that is, through the JSON_UNESCAPED_UNICODE parameter, for example:
json_encode("Chinese", JSON_UNESCAPED_UNICODE) For earlier PHP versions, Chinese is not processed. JSON encoding of characters. I have previously written an article on PHP outputting Chinese JSON strings. Here is a more perfect method:
/**
* JSON encoding method without escaping Chinese characters
* @param array $arr Array to be encoded
* @return string
*/
function encode ($arr) {
$str = json_encode($arr);
$search = "#\u([0-9a-f]+)#ie";
$replace = "iconv('UCS -2', 'UTF-8', pack('H4', '\1'))";
return preg_replace($search, $replace, $str);
}
Source: Mango Station