MySQL garbled reason is simply the following reasons:
1, it is stored in the database before garbled
2, stored in the database in the process of garbage
3, after the deposit into the database garbled
Want to know where the garbled very simple to print in the background will know.
Now that you know where the problem is, that the solution is very simple:
1, jsp set the encoding is utf-8, to ensure that the background is reached encoding utf-8’s
2, the database connection plus in such a period of jdbc: mysql: //localhost: 3306/test? useUnicode=true & characterEncoding = UTF-8 , to ensure that the transfer process is utf-8’s.
3. Set the database encoded as utf-8, set or Config settings are also lines in my.ini, attention is my.ini in default-character-set to change two places
4, url or easyui garbled, you can try in the tomcat’s server.xml
<Connector port = "8080" protocol = "HTTP / 1.1" connectionTimeout = "20000" redirectPort = "8443" />
To
<Connector port = "8080" protocol = "HTTP / 1.1" connectionTimeout = "20000" redirectPort = "8443" URIEncoding = "utf-8" />
To ensure that no garbage, the first to do the coding to unify, other problems are easy to find out. END.
Recent Comments