The following article describes how to solve the Chinese problem in jsp MySQL and how to describe the actual application code in actual operations, if you are interested in solving the Chinese problem in jsp MySQL, the following articles will satisfy your curiosity.
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 zookeeper defined in JSPMySQL is not a UTF-8.
It's a pity that MySQL does not yet have 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" %>
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” %>
Http://www-900.ibm.com/developerWorks/cn/java/java_chinese/index.shtml reference this article
The above content is an introduction to the Chinese issue of jsp MySQL. I hope you will have some gains.
Original article title: jsp MySQL Chinese problems
Connection: http://www.cnblogs.com/bobomail/archive/2005/03/18/121068.html