public String gbTo(String s)
{
String s1 = null;
try
{
s1 = new String(s.getBytes("GB2312"), "8859_1");
}
catch(Exception exception) { }
return s1;
}
{
String s1 = null;
try
{
s1 = new String(s.getBytes("GB2312"), "8859_1");
}
catch(Exception exception) { }
return s1;
}
{
String s1 = null;
try
{
s1 = new String(s.getBytes("8859_1"), "GB2312");
}
catch(Exception exception) { }
return s1;
}
在jsp页面加上这个。你搜一下啊,很多这样的问题。
还有涉及倒与数据库或bean传值时需要使用
str = new String(str.getBytes("8859_1"))