The problem of Chinese garbled characters in PHPMyAdmin is very common and very annoying. I rarely used PHPMyAdmin in the past. After installing it recently, I found it very convenient. However, I also encountered the problem of garbled Chinese characters. The main reason is that UTF-8 and GB2312 encoding cannot be displayed correctly at the same time. I found some information from the Internet, but it is not very direct. Now I will reorganize it based on my own operation.
1. Because the default encoding of MySQL is latin1, we first need to modify the encoding conversion of PHPMyAdmin. Modify the select_lang.lib.php file under the libraries directory and change
[indent]
'utf-8' => 'utf8',
Modify to
'utf-8' => 'latin1',
[/indent]
2. Next, we need to modify the encoding display of the page.
[indent]
'zh-gb2312' => array('zh|chinese simplified', 'chinese_simplified-gb2312', 'zh'),
Modify to
'zh-gb2312-utf-8' => array('zh|chinese simplified', 'chinese_simplified-gb2312', 'zh'),
[/indent]
That is, add -utf-8 after zh-gb2312, so that the page encoding supports UTF-8.
3. First select zh-gb2312-utf-8 to enter PHPMyAdmin. At this time, browsing GB2312 encoded data is normal, but browsing UTF-8 data is garbled. If you want to browse UTF-8 data, go to the homepage and select zh-utf-8 in Language.
[b] A few notes: [/b]
1. The default language encoding is very long. You can comment out other encodings with /**/, leaving only zh-gb2312-utf-8 and zh-utf-8. coding.
2. Currently, the latest version of PHPMyAdmin is 2.8.0-rc1, but the language selected on the homepage of this version cannot be specific to the encoding, so it is not recommended to use it.