Get Post乱码


get乱码
方法1(麻烦): new String(name.getBytes("iso8859-1"),"utf-8");
方法2: 在server.xml中增加URIEncoding="UTF-8"
<Connector port="80" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" URIEncoding="UTF-8"/>
post乱码
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");

猜你喜欢

转载自miao-miu.iteye.com/blog/2391039