Post方式亂碼:request.setCharacterEncoding(“utf-8”);
GET方式:
1.修改tomcat解碼字符集 conf/server.xml URIEndoing=”utf-8”
2.手動重新編碼
username = URLEncoder.encode(username, “ISO-8859-1”);
username = URLDecoder.decode(username,”utf-8”);
簡化:
username = new String(username.getBytes(“ISO-8859-1”), “utf-8”);
新聞熱點
疑難解答