UseUnicode = true & amp; characterEncoding = UT

Source: Internet
Author: User
The role of useUnicodetruecharacterEncodingUTF-8 in mysql connection url reproduced: www.cnblogs.comxuefuwuarchive201205062486577.html? We usually add useUnicodetruecharacterEncodingUTF-8 after the url when connecting to the mysql database, but ask what to add

Mysql connection url in useUnicode = truecharacterEncoding = UTF-8 role reprint: http://www.cnblogs.com/xuefuwu/archive/2012/05/06/2486577.html? We usually add useUnicode = truecharacterEncoding = UTF-8 after the url when connecting to the mysql database, but ask what to add

Functions of useUnicode = true & characterEncoding = UTF-8 in mysql connection url

Reprinted: http://www.cnblogs.com/xuefuwu/archive/2012/05/06/2486577.html

?

When we connect to the mysql database, we usually add useUnicode = true & characterEncoding = UTF-8 after the url, but what do you want to add?

?

The added function is 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 has the following two aspects:

1. When saving data:

? ? ?When the database stores project data, it first decodes the data into bytecode in UTF-8 format, and then stores the decoded bytecode into the database again using GBK encoding.

2. Data retrieval:

? ? ?When retrieving data from the database, the database first decodes the data in the database in GBK format into bytecode, and then decodes the decoded bytecode and re-encodes the data in UTF-8 format, finally, return the data to the client.

Note: When configuring the database utl in the xml configuration file, use the & escape character, that is &

? ? ?? For example:

Common special characters in HTML:

?

Character Entities) Display result description Entity NameEntity Number
? Display a space    
< Less < <
> Greater > >
& & Symbol & &
" Double quotation marks " "
Character Entities) Display result description Entity NameEntity Number
? Copyright © ©
? Registered Trademark ® ®
× Multiplication number × ×
Bytes Division Number & Pide; Bytes

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.