Thoroughly solve PHPMyAdmin Chinese UTF-8 garbled problem, read thoroughly solve PHPMyAdmin Chinese UTF-8 garbled problem, PHPMyAdmin Chinese garbled problem is very common, but also very annoying. Previously PHPMyAdmin is relatively small, recently installed after very convenient, but also encountered a Chinese garbled problem, mainly UTF-8 and GB2312 encoding cannot be at the same time)
Chinese garbled text in PHPMyAdmin is common and annoying. Previously with PHPMyAdmin is relatively small, recently installed after the very convenient, but also encountered a Chinese garbled problem, mainly UTF-8 and GB2312 encoding cannot be correctly displayed at the same time. I found some materials from the Internet, but they are not very direct. now I will repeat them with my own operations.
1. because the default encoding of MySQL is latin1, we need to modify the encoding and conversion of PHPMyAdmin. Modify the select_lang.lib.php file under the libraries Directory
[Indent]
'Utf-8' => 'utf8 ',
Modify
'Utf-8' => 'latin1 ',
[/Indent]
2. modify the code display on the page
[Indent]
'Zh-gb2312 '=> array ('zh | chinese simplified', 'Chinese _ simplified-gb2312 ', 'zh '),
Modify
'Zh-gb2312-utf-8 '=> array ('zh | chinese simplified', 'Chinese _ simplified-gb2312 ', 'zh '),
[/Indent]
That is to add-UTF-8 behind the zh-gb2312, so that the page encoding supports the UTF-8.
3. first select the zh-gb2312-utf-8 to enter PHPMyAdmin, this time browsing the data of GB2312 encoding is normal, but browsing the UTF-8 data is garbled. If you browse the data of the UTF-8, go to the home page, and then select the zh-utf-8 in the Language.
[B] notes: [/B]
1. the default language encoding is very long and you can annotate it with/**/to keep only the zh-gb2312-utf-8 and zh-utf-8 encoding.
2. the latest PHPMyAdmin version is 2.8.0-rc1, but the language selected on the homepage of this version cannot be specific to the encoding. Therefore, it is not recommended that you use this version.