Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if phpmyadmin displays Chinese garbled codes in utf8_general_ci?

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article will explain in detail how to display Chinese garbled codes in utf8_general_ci on phpmyadmin. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

I have been writing PHP for more than a year, but the coding problem has not been solved well. In my own case, this is the case.

The display of the web page is completely normal, and the Chinese garbled code is displayed in the phpmyadmin database, whether in simplified or traditional Chinese, as long as it is in the following form: … æ,

However, the web page written by myself shows completely normal, no matter it is traditional or simplified, it will not garbled.

Of course, my web page is saved in utf-8 format, plus I added mysql_query ("set names' utf-8'") when I read the library. So what you see in the web page is completely normal, of course, only the phpmyadmin shows garbled code, if you see here, the web page part is garbled, as I said, save the webpage notepad as utf-8 format, and then add mysql_query ("set names' utf-8'") when reading the database after you specify it in the web page. There must be no garbled, of course, the database, data tables, fields should also be saved in the form of utf8_general_ci coding, through the above operations, there will be absolutely no garbled in the web page, today I am here to explain the problem of garbled displayed in phpmyadmin, this is the final article to solve garbled, after reading this article, garbled will no longer appear in our program and database.

OK, after reading the part of using the text, you will absolutely not have the problem of garbled code in the web page. However, it is still garbled to display Chinese in phpmyadmin. I spent a day carefully analyzing my own code, coding format, and phpmyadmin coding format. Searching GG and asking advanced technical personnel are all fruitless. Of course, it is better to ask for help than to ask yourself, and then analyze the coding problem slowly. Finally found the question of why you will show garbled codes in phpmyadmin. If you want to have an in-depth understanding of the coding problems, in order not to let garbled codes bother you in the future, you should check these two differences: utf8 and utf-8, despite the fact that everything is the same, only one more line, a missing line, will make your phpmyadmin garbled. OK, analyze your own garbled situation and change the red word part. The following are the ultimate ways to pay attention to the occurrence of anti-garbled codes, including garbled problems in web pages and phpmyadmin:

1 Save all web pages as utf-8 with notepad, as shown in the figure:

Note: ANSI is suitable for BIG5 and GBK

2 specify the encoding format in your own web page, which is relatively simple and does not explain much.

3. Database operation plus mysql_query ("set names' utf8'") See clearly is utf8, not utf-8, related line, using utf-8 in phpmyadmin will be garbled, write your own program for more than a year, have been using utf-8, led to the phpmyadmin has been garbled format, now change back to utf8 finally solved the phpmyadmin display of Chinese garbled problem, but one should pay attention, after changing to utf8, your previous storage of Chinese will be read in the web page will be garbled, if the content is very much, do not change it At most, only phpmyadmin is garbled, the display in the web page is always normal, here is changed to utf8 when developing the program in the future, this is the web page, all phpmyadmin display will be normal, for garbled problem 88.

4 the encoding format of the database is utf8_general_ci, the table format is also utf8_general_ci, and the Chinese fields are also in utf8_general_ci. See the map of phpmyadmin:

The above libraries and tables are sorted out as utf8_general_ci, followed by field maps:

On "phpmyadmin display utf8_general_ci Chinese garbled code how to do" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report