servlet3.0二进制方式提交表单,普通表单中文乱码问题
因为二进制提交长度太长,get有长度限制,所以使用post方式提交表单
一般来说post方式提交表单使用:
response.setCharacterEncoding("utf-8");
就能解决
但是这个地方不适用这种方式
post提交了一个没有编码的表单,然后你要取出里面的值,它现在的值都是以字节形式存在,使用utf-8对他重新编码
//需要将接收数据重新编码
String sname=new String(sname.getBytes("ISO-8859-1"), "utf-8");

相关文章:

  • 2022-12-23
  • 2021-12-08
  • 2021-07-20
  • 2022-12-23
  • 2022-12-23
  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-18
  • 2021-10-16
  • 2021-11-08
  • 2021-07-18
  • 2021-06-23
  • 2022-12-23
相关资源
相似解决方案