Solve the problem of PHPMyAdmin Chinese UTF-8 garbled

Source: Internet
Author: User
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.

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.