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删除。