SSH 中文乱码问题

1、使用

<%

   request.setCharacterEncoding("GBK");

  %>

在获取表单信息之前进行统一的编码。

该方式仅用于post方式提交的表单。

2、对获取的信息进行重新编码

String name=request.getParameter("userName");

byte b[]=name.getBytes("ISO-8859-1");Tomcat服务器使用的默认编码。

name =new String(b);


你可能感兴趣的:(ssh,中文乱码问题)