1.html中文問題
<meta http-equiv="Content-Type" content="text/html;charset="gb2312">
2.jsp頁面中文問題
<%@ page contentType="text/html;charset=gb2312" language="java"%>
3.servlet響應結果中文問題
response.setCharacterEncoding("gb2312");
4.頁面數據傳輸中文問題
在web.xml中配置<filter>
5.http(get)請求中文問題
String param=request.getParameter("param");
if(param!=null) param=new String(param.getBytes("ISO-8859-1"),"gb2312");
如果 http(get)請求中傳遞中文參數比較多,可以修改tomcat下server.xml
<Connector port="8080"
maxThreds="150"
minSpareThreds="25"
maxSpareThreds="75"
enableLookups="false"
redirectPort="8443"
acceptCount="100"
debug="0"
connection Timeout="20000"
disableUploadTimeout="true"
URIEncoding="GB2312"/>
6.mysql中文問題
在jdbc驅動的URL上:
jdbc:mysql://localhost/test?user=root&password=123&useUnicode=true&characterEncoding=gb2312
或修改mysql.ini 下的mysql默認字符設置
posted on 2008-05-25 23:31
長春語林科技 閱讀(206)
評論(0) 編輯 收藏 所屬分類:
util