Fix data garbled headers in phpMyAdmin2.6 or later versions

Source: Internet
Author: User
PhpMyAdmin2.6 and later versions support multi-language sets, so when we use phpMyAdmin to govern the database, the Chinese query is garbled, but these headers are not found during our PHP program calls. It seems that the phpMyAdmin2.6 configuration is marked

PhpMyAdmin2.6 and later versions support multi-language sets, so when we use phpMyAdmin to govern the database, the Chinese query is garbled, but these headers are not found during our PHP program calls.
It seems that the configuration of phpMyAdmin2.6 has a title. to determine this title, I searched for related materials on google. There are many titles, but none of them can solve the problem. there is no solution, it seems that you have only done it yourself.

... The process of searching source code is cumbersome

In the end, it took half a day to finally find a more harmonious solution.

Open the following file under the root directory of phpMyAdmin2.6: libraries/select_lang.lib.php

1. find the line with 'zh-gb2312 'and change 'zh-gb2312' to 'zh-gb2312-utf-8'
Why? That is because the server will filter out the language without '-utf-8', and then in libraries/database_inte **** ce. lib. php lines 168th: "To prevent obfuscation,": <

Or if you do not change 'zh-gb2312 'to 'zh-gb2312-utf-8', you can filter it out. If you drop the option, it will be OK.

2. find '$ mysql_charset_map = array (' that line
Set 'gb2312' => 'gb2312 ',
Change to 'gb2312' => 'latin1 ',

Retain, OK, in The phpMyAdmin governance, select the language chinese simplified (zh-gb2312-utf-8)
Let's look at your Chinese data.

Therefore, my solution is to correct the two words in the file libraries/select_lang.lib.php, which is convenient and quick. haha.

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.