The following articles mainly introduce the solutions to some Chinese problems of jsp MySQL. The actual application proportion of jsp MySQL is still the majority. If you are curious about this technology, the following articles will unveil its mysteries. The following is a detailed description of the relevant content.
Jsp MySQL does not seem to support UTF-8 and unicode
Using UTF-8 is actually true for JSP
For websites, it is often necessary to import or export documents from multiple countries.
It is more convenient than others.
In fact, you can still set the parameter settings of JSP, as long as you remember to add them.
Otherwise, the JSP internal handler is not a UTF-8.
But unfortunately, jsp MySQL has not yet had a complete support UTF-8
But don't be discouraged.
Utf8 needs to be added on the page
- <%@ page contentType="text/html;charset=utf-8" %>
Reference
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.
Sp 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.