把中文的字段用一个函数转化一下再存进去!!
public String tochinese(String str)
{
try
{
if (str==null)
{
return "";
}
else
{
str=new String(str.getBytes("ISO8859_1"),"GBK");
return str;
}
}catch (Exception e){return null; }
}
public String tochinese(String str)
{
try
{
if (str==null)
{
return "";
}
else
{
str=new String(str.getBytes("ISO8859_1"),"GBK");
return str;
}
}catch (Exception e){return null; }
}
flashroom(找到啦)的方法应该是有效的阿.
<%@ page contentType="text/html; charset=gb2312"%>
改为
ISO8859_1
适宜市