tomcat下中文乱码
傻傻的找出适合的编码转换。
String s = request.getparameter("name");
String a = new String(s.getBytes("gb2312"),"utf-8")
System.out.println(a);
a = new String(s.getBytes("ISO8859-1"),"utf-8")
System.out.println(a);
a = new String(s.getBytes("ISO8859-1"),"gb2312")
System.out.println(a);
a = new String(s.getBytes("utf-8"),"gb2312")
System.out.println(a);
a = new String(s.getBytes("gb2312"),"ISO8859-1")
System.out.println(a);
a = new String(s.getBytes("utf-8"),"ISO8859-1")
System.out.println(a);