好多次遇到过这种问题,每次都解决,记录下,希望对以后碰到这个问题的人有所帮助。
见以下代码:
String schoolname = request.getParameter("school");
byte[] bytes = schoolname.getBytes("iso-8859-1");
String sname = new String(bytes, "UTF-8");
System.out.println(sname);
见以下代码:
String schoolname = request.getParameter("school");
byte[] bytes = schoolname.getBytes("iso-8859-1");
String sname = new String(bytes, "UTF-8");
System.out.println(sname);