Several causes of MySQL garbled characters
MySQL is garbled for the following reasons:
1. garbled characters before they are stored in the database
2. garbled Characters During database saving
3. garbled characters after being stored in the database
It's easy to know where Garbled text appears. Print it in the background.
Now that you know where the problem is, the solution is simple:
1. Set the UTF-8 encoding in jsp to ensure that the UTF-8 encoding is passed to the background.
2. Add jdbc: mysql: // localhost: 3306/test? To the database connection? UseUnicode = true & characterEncoding = UTF-8, ensure that the transmission process is UTF-8.
3. set the database encoding to UTF-8 and set it in my. ini or Config. Note that the default-character-set in my. ini needs to be changed to two places.
4. url or easyui garbled characters. You can try
<Connector port = "8080" protocol = "HTTP/1.1" connectionTimeout = "20000" redirectPort = "8443"/>
Change
<Connector port = "8080" protocol = "HTTP/1.1" connectionTimeout = "20000" redirectPort = "8443" URIEncoding = "UTF-8"/>
To ensure that there are no garbled characters, we must first unify the codes and find out other problems. .
This article permanently updates the link address: