The following articles mainly introduce the causes of Chinese problems in jsp MySQL and the actual solutions to Chinese problems in jsp MySQL. If you are interested in the actual operations, the following articles will satisfy your curiosity.
Utf8 needs to be added on the page
- <% @ Page contentType = "text/html; charset = UTF-8" %>
Java uses unicode to display Chinese including UTF-8 and UTF-16
When developing applications based on the Java programming language, we must inevitably process Chinese characters. The default encoding method of Java programming language is UNICODE, and the databases and files we usually use are all encoded Based on GB2312.
Jsp Chinese display is required
Another problem is that Chinese characters are correctly encoded and converted during Java programming. For example, when you output a Chinese string to a webpage
- Out. println (string );
Still used
<% = String %>, must be converted from UNICODE to GBK, either manually or automatically. In JSP 1.0, you can define the output character set to automatically convert the internal code. Usage is
- <% @ Page contentType = "text/html; charset = gb2312" %>
The above content is an introduction to the Chinese issue of jsp MySQL. I hope you will have some gains.