response.setContentType( "text/html;charset=GBK ");
PrintWriter out = response.getWriter();
out.println( "中国画 ");//不是中文就没救了;
out.println(request.getParameter( "param "));//不是中文正常
下面那个问题是你request.getParameter()的问题,要做编码转换byte[] tmpbyte= str.getBytes( "ISO8859_1 ");
String newstr = new String (tmpbyte);
out.println(newstr)就ok了,前提:response.setContentType( "text/html;charset=GBK ")
PrintWriter out = response.getWriter();
out.println( "中国画 ");//不是中文就没救了;
out.println(request.getParameter( "param "));//不是中文正常
下面那个问题是你request.getParameter()的问题,要做编码转换byte[] tmpbyte= str.getBytes( "ISO8859_1 ");
String newstr = new String (tmpbyte);
out.println(newstr)就ok了,前提:response.setContentType( "text/html;charset=GBK ")