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!