解决前端到后台Controller的get/post乱码问题

前端传参数 name:张三

后端接受:$$$$$%%%

直接上代码:

解决:

try {
name= new String(name.getBytes("iso-8859-1"), "utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}

 

完美解决

posted @ 2021-04-20 15:05  丿狂奔的蜗牛  阅读(127)  评论(0编辑  收藏  举报