手动编解码解决get提交错误的问题
1 String username = request.getParameter("username");
2 System.out.println("username="+username);
3
4 //反向编码, 将乱码再编码回二进制
5 byte[] bytes = username.getBytes("iso8859-1");
6 //拿着二进制数组去查正确的码表, 返回正确的数据
7 username = new String(bytes, "utf-8");
8
9 System.out.println("username="+username);