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 |