Complete Solution phpmyadmin Chinese UTF-8 garbled problem _php Tutorial

Source: Internet
Author: User
PHP (as the current mainstream development language) MyAdmin's Chinese garbled problem is very common, but also very annoying. Before using PHP (as the current mainstream development language) MyAdmin 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 the default encoding for MySQL (and the best combination of PHP) is latin1, first we need to revise the Code conversion of PHP (as the current mainstream development language) MyAdmin. Modify the select_lang.lib.php (as the current mainstream development language) file under the Libraries directory to
[Indent]
Utf-8 = UTF8,
Modified into
Utf-8 = Latin1,
[/indent]


2. The next step is to modify the page encoding display,
[Indent]
zh-gb2312 = Array (Zh|chinese simplified, chinese_simplified-gb2312, zh),
Modified into
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 into PHP (as the current mainstream development language) MyAdmin, this time to browse GB2312 encoded data is normal, but browsing 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 inside.


A few notes:

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

2. Currently PHP (as the current mainstream development language) MyAdmin The latest version is 2.8.0-RC1, but this version of the first page of the selected language can not be specific to the encoding, so it is not recommended.

http://www.bkjia.com/PHPjc/508897.html www.bkjia.com true http://www.bkjia.com/PHPjc/508897.html techarticle PHP (as the current mainstream development language) MyAdmin's Chinese garbled problem is very common, but also very annoying. Previously with PHP (as the current mainstream development language) MyAdmin relatively few, recently loaded with ...

  • 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.