出现乱码原因
-
因为编码和解码的字符集编码不一致
解决( 看提交方式为get还是post )
post:
request.setCharacterEncoding("utf8");
response.setContentType("text/html;charset=utf-8");
get:
name=new String(name.getBytes("iso8859-1"),"utf-8");
希望对您有帮助!记得点赞、收藏、关注哦!