Mysql connection url in useUnicode = true & amp; characterEncoding = UTF-8

Source: Internet
Author: User

Mysql connection url useUnicode = true & characterEncoding = UTF-8 in our connection to the mysql database will generally add useUnicode = true & characterEncoding = UTF-8 after the url, but what do you want to add? Www.2cto.com is used to specify the encoding and decoding formats of characters. For example, the mysql database uses gbk encoding, while the project database uses UTF-8 encoding. At this time, if useUnicode = true & characterEncoding = UTF-8 is added, the role of the following two aspects: 1. data storage: the database will first use the UTF-8 format to decode the data into bytecode, and then the decoded bytecode re-use GBK encoding to store in the database. 2. data Retrieval: When www.2cto.com retrieves data from the database, the database first decodes the data in the database into bytecode in GBK format, then encode the decoded bytecode again in UTF-8 format, and finally return the data to the client. Note: When configuring the database URL in the xml configuration file, use the & escape character, that is, & amp; for example: <property name = "url" value = "jdbc: mysql: // localhost: 3306/email? UseUnicode = true & amp; characterEncoding = UTF-8 "/> special characters commonly used in HTML: Character Entities) the display result indicates that Entity Name Entity Number displays a Space & nbsp; & #160; <less than & lt; & #60;> greater than & gt; & #62; & Symbol & amp; & #38; "Double quotation marks & quot; & #34; display result description of other commonly used Character Entities (Character Entities) Entity Name Entity Number? Copyright & copy; & #169 ;? Registered Trademark & reg; & #174; × multiplication number & times; & #215; except for "divide" & #247;

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.