前端传到后台中文乱码---个人心得

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");

原文地址:https://www.cnblogs.com/wangleBlogs/p/10168796.html