Solve phpMyAdmin Chinese UTF-8 garbled problem thoroughly

Source: Internet
Author: User
Tags phpmyadmin
Solve phpMyAdmin Chinese UTF-8 garbled problem thoroughly

phpMyAdmin Chinese garbled problem is very common, but also very annoying. Previously used phpMyAdmin relatively few, recently installed after feeling very convenient, but also encountered the problem of Chinese garbled, mainly UTF-8 and GB2312 encoding can not be displayed correctly at the same time. Found some information from the Internet, but are not very direct, now combined with their own operations to reorganize.
1. Because MySQL's default encoding is latin1, we first need to modify the phpMyAdmin encoding conversion. Modify the select_lang.lib.php file under the Libraries directory to


1. ' Utf-8 ' => ' UTF8 ',
2. Modified into
3. ' Utf-8 ' => ' latin1 ',





2. The next step is to modify the encoding of the page to show


1. ' zh-gb2312 ' => array (' Zh|chinese simplified ', ' chinese_simplified-gb2312 ', ' ' zh '),
2. Modified into
3. ' Zh-gb2312-utf-8 ' => array (' Zh|chinese simplified ', ' chinese_simplified-gb2312 ', ' ' zh '),



That is, add-utf-8 behind the zh-gb2312, so that the page code supports UTF-8.

3. First select Zh-gb2312-utf-8 into phpMyAdmin, this time browsing GB2312 encoded data is normal, but browse UTF-8 data is garbled. If you browse UTF-8 data, go to the home page, and then choose Zh-utf-8 on the language.


A few notes:

1. The default language encoding is very long, you can annotate other encodings with/**/, leaving only Zh-gb2312-utf-8 and zh-utf-8 two encodings.

2. The latest version of the current phpMyAdmin is 2.8.0-r

</

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.