1、如果JDBC能正确存取中文的话.
contenttype="text/htmlchaterset=gb2312"
例:
<%@pagelanguage="java"contentType="text/html;charset=GB2312"import="java.sql.*"%>
2、JDBC中无法正确存储中文
(1)Stringaddress=request.getParameter("address");
byte[]tmpbyte=address.getBytes("ISO8859_1");
address=newString(tmpbyte);
(2)
Stringname=request.getParameter("name");
name=newString(name.getBytes("gb2312"),"ISO8859_1");
"ISO8859_1"和"gb2312"可以尝试交换 |