|
发表于 2006-12-7 13:42:22
|
显示全部楼层
我也是用以下三点解决的:第二点用的是spring
1.all the jsp page is encoding GBK like this:
<%@ page contentType="text/html; charset=GBK" pageEncoding="GBK"%>
<meta http-equiv="content-type" content="text/html; charset=GBK">
2. connect mysql using GBK encoding in applicationContext.xml
<property name="url">
<value>jdbc:mysql://localhost:3306/Bag?useUnicode=true&characterEncoding=GBK</value>
</property>
remember that ';' is marked '&', otherwise is show error about 'need ;'
3. both tables and columns encoded GBK
it ensure save and get chinese data from mysql normally |
|