PhpMyAdmin: how to display Chinese garbled characters _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
Tags mysql commands
PhpMyAdmin solves the problem of garbled Chinese characters. According to my experience, garbled characters in php and mysql are generally document encoding problems, such as gbk, uft8, and gb2312, which are inconsistent with page encoding, the solution for displaying Chinese garbled characters in phpMyAdmin is summarized below. Based on my experience, php and mysql usually encounter file encoding problems, such as gbk, uft8, and gb2312, which are inconsistent with page encoding, next, I will summarize the solutions for phpMyAdmin to display Chinese garbled characters.

First Look

Solution 1

Php. ini does not have extension = php_mysql.dll

When you encounter this problem, you will usually see it when you open phpmyadmin.

Garbled error

Copy libmysql. dll in php to c: \ windows \ system32 or c: \ winnt \ system32.

Then restart the computer.

Solution 2

The following is my modification process:
Open the libraries/select_lang.lib.php file in the phpMyAdmin root directory;
Find:

The code is as follows:
'Zh-gb2312 '=> array ('zh | chinese simplified', 'Chinese _ simplified-gb2312 ', 'zh', 'China '),


Change it:

The code is as follows:
'Zh-gb2312-utf-8 '=> array ('zh | chinese simplified-UTF8', 'Chinese _ simplified-gb2312 ', 'zh', 'China '),


Find again:

The code is as follows:
'Gb2312' => 'gb2312 ',


Change it:

The code is as follows:
'Gb2312' => 'latin1 ',

Save the file and exit.

Then open phpMyAdmin from the browser, on the home page select Language: Chinese-Chinese simplified-UTF8

Open the data table and check whether the Chinese characters in the table are properly displayed :)


Solution 3


By default, tables in Mysql use latin1 encoding. However, if the content is added using mysql commands, it is generally inserted using gb2312 encoding. the language is directly used in phpmyadmin: chinese-Chinese simplified: garbled characters

1. open libraries/select_lang.lib.php, search for the $ available_ages array, and add a data item at the end:

Php code

The code is as follows:
1. 'zh-gb2312-utf-8 '=> array ('zh | chinese simplified latin1', 'Chinese _ simplified-gb2312', 'zh ', 'China ')
'Zh-gb2312-utf-8 '=> array ('zh | chinese simplified latin1', 'Chinese _ simplified-gb2312 ', 'zh', 'China ')

Note: Chinese represents the word "Chinese.

2. search $ mysql_charset_map and find the array. change the value 'gb2312' => 'gb2312 'to 'gb2312' => 'latin1 '.

3. open phpmyadmin again. Select Chinese language-Chinese simplified latin1


Then open the latin1 encoded table and you will see that the garbled characters are no longer there:

Gbk, uft8, and gb2312 are inconsistent with the page code. below I summarize the solution for phpMyAdmin to display Chinese garbled characters...

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.