The purpose of the addition is to specify the encoding and decoding format of the characters.
For example: The MySQL database uses GBK encoding, and the project database uses UTF-8 encoding. If Useunicode=true&characterencoding=utf-8 is added at this time, then there are two aspects of the function:
1. When data is stored:
When storing the project data, the database decodes the data into bytecode using the UTF-8 format, and then the decoded bytecode is reused in the database using the GBK encoding.
2. When data is taken:
When fetching data from the database, the database will first decode the data in the database into bytecode in GBK format, then encode the decoded bytecode again in UTF-8 format, and then return the data to the client.
NOTE: When you configure Database utl in an XML configuration file, to use the & escape character is also & For example:
<name= "url" value= "Jdbc:mysql://localhost:3306/email?" Useunicode=true&characterencoding=utf-8 "/>
Special characters commonly used in HTML:
Most commonly used character entities (Character entities)
Show results |
Description |
Entity Name |
Entity number |
|
Show a space |
|
& #160; |
< |
Less than |
< |
& #60; |
> |
Greater than |
> |
& #62; |
& |
& Symbols |
& |
& #38; |
" |
Double quotes |
" |
& #34; |
Other commonly used character entities (Character entities)
Show results |
Description |
Entity Name |
Entity number |
© |
Copyright |
© |
& #169; |
® |
Registered trademarks |
® |
& #174; |
X |
Multiplication sign |
× |
& #215; |
÷ |
Division Sign |
÷ |
& #247; |
The role of useunicode=true&characterencoding=utf-8 in MySQL connection URL