1.在tomcat-server.xml里面找到 <Connector 標簽里面寫入 URLEncoding="UTF-8"
2.String str = new String(你的亂碼字符串.getBytes("ISO8859_1"), "GBK");
如果你的前端是utf-8編碼:
String str = new String(你的亂碼字符串.getBytes("ISO8859_1"), "utf-8");
1.在tomcat-server.xml里面找到 <Connector 標簽里面寫入 URLEncoding="UTF-8"
2.String str = new String(你的亂碼字符串.getBytes("ISO8859_1"), "GBK");
如果你的前端是utf-8編碼:
String str = new String(你的亂碼字符串.getBytes("ISO8859_1"), "utf-8");
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。