字符编码时为什么转换中文不好使啊!
String Chinese=new String((name.getBytes("iso-8859-1")),"gb2312");
System.out.println(Chinese);
----------------------------------
这种方法也不好使
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
try {
request.setCharacterEncoding("gb2312");
chain.doFilter(request, response);
} catch (Exception e) {
e.printStackTrace();
}
}
请各位帮帮忙