网上大部分乱码解决方案无非三种.
1.设置tomcat配置 URIEncoding="utf-8";
2.设置请求的字符集 request.setCharacterEncoding("UTF-8");
3.利用 new String(s.getBytes("iso-8859-1"),"utf-8");
此三种基本上能解决遇到的字符集问题,但是如果是两个服务之间的后台post请求,需要注意设置一下请求参数的字符集.
即 : URLEncoder.encode(params, "UTF-8");