Several causes of MySQL garbled characters

Source: Internet
Author: User

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:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.