- Querys. json:
- {"Cities": ["\ u4e0a \ u6d77", "\ u4e1c \ u839e", "\ u4e2d \ u5c71", "\ u4e3d \ u6c34 ", "\ u4e4c \ u9c81 \ u6728 \ u9f50", "\ u4f5b \ random", "\ u4fdd \ u5b9a", "\ u5170 \ u5dde", "\ u5317 \ u4eac ", "\ u5357 \ u4eac", "\ u5357 \ u5b81", "\ u5357 \ u660c", "\ u5357 \ u901a", "\ u8d35 \ u9633 ", "\ u8fde \ u4e91 \ u6e2f", "\ u90a2 \ u53f0", "\ u90af \ u90f8", "\ u90d1 \ u5dde", "\ u91cd \ u5e86 ", "\ u91d1 \ u534e", "\ u94f6 \ u5ddd", "\ u9547 \ u6c5f", "\ u957f \ u6625", "\ u957f \ u6c99 ", "\ u9752 \ u5c9b"]}
2. php Chinese character transcoding file test. php
-
Header ("content-Type: text/html; charset = Utf-8 ");
- Set_time_limit (0); // sets the number of seconds that a program can run. 0 is the maximum value.
-
$ File = "querys. json ";
- $ Content = file_get_contents ($ file );
- Echo $ content ."
";
-
Function replace_unicode_escape_sequence ($ match ){
- Return mb_convert_encoding (pack ('H * ', $ match [1]), 'utf-8', 'ucs-2be ');
- }
- $ Str = preg_replace_callback ('// \\\ u ([0-9a-f] {4})/I', 'replace _ unicode_escape_sequence ', $ content );
- Echo $ str;
- ?>
|