从表单中传过来的汉字可能会出现乱码,需要对其从"ISO8859-1"转换成"gb2312"
package com.tool;
public class Chinese {
public static String toChinese(String strvalue) {
try {
if(strvalue == null) {
return "";
} else {
strvalue =
new String(strvalue.getBytes("ISO8859-1"),"gb2312")
return strvalue;
}
}catch(Exception e) {
e.printstacktree();
}
}
}