Home  >  Article  >  CMS Tutorial  >  What to do if Chinese garbled characters appear in phpcms

What to do if Chinese garbled characters appear in phpcms

angryTom
angryTomOriginal
2020-02-19 14:55:022919browse

What to do if Chinese garbled characters appear in phpcms

What to do if Chinese garbled characters appear in phpcms

I learned to use phpcms to develop a file management module, but Chinese garbled characters appeared, and I struggled for a long time. The summary is as follows

1. Create a table on the mysql client. The default table encoding is latin1_swedish_ci. Although you can use the alter command to modify the encoding after it is built, it will cause many problems, especially garbled characters.

2. phpcms system installation module method, the default table encoding is gbk_general_ci.

Note the difference between 1 and 2. This can easily lead to garbled Chinese characters.

3. When writing code with the notepad editor, except for the sql database installation file, it is best to set everything else to Simplified Chinese. Otherwise, Chinese garbled characters will appear.

In short, the coding must be unified from the database to the web page source code.

Related recommendations: phpcms learning

The above is the detailed content of What to do if Chinese garbled characters appear in phpcms. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn