Chinese characters are often garbled in php or mysql. Most of the reasons for this problem are the database encoding or client encoding problems. The following describes how to solve Chinese garbled characters.
Chinese characters are often garbled in php or mysql. Most of the reasons for this problem are the database encoding or client encoding problems. The following describes how to solve Chinese garbled characters.
Refer to the following solutions
Click a connection -- properties-switch to the Advanced tab-remove the use mysql character set Option checked-select 65001 (UTF-8) or 10008-GB2312 at encoding, then, the Chinese characters are displayed normally.
If the above method cannot be solved, refer
The default encoding in the my. ini file under the mysql installation directory is incorrect.
| The Code is as follows: |
|
========================================================== =
[Mysql]
Default-character-set = utf8 <------
========================================================== =
[Mysqld]
# The TCP/IP Port the MySQL Server will listen on
Port = 3306
# Path to installation directory. All paths are usually resolved relative to this.
Basedir = "C:/Program Files/MySQL Server 5.0 /"
# Path to the database root
Datadir = "C:/Program Files/MySQL Server 5.0/Data /"
# The default character set that will be used when a new schema or table is
# Created and no character set is defined
Default-character-set = utf8 <------
|
========================================================== ===
The arrow indicates utf8 (not UTF-8). The mysql character set is used in navicat (UTF-8 encoding is not required at this time ).