一:
在JSP里加上<%@ page contentType="text/html;charset=gb2312" %>试试二:
String aaa = request.getParameter("aaa");
if(aaa!=null){
aaa = new String(aaa.getBytes("iso-8859-1"),"gb2312")
out.println(aaa);
}三:
strName = new String(request.getParameter("name").getBytes("ISO-8859-1"));
iso-8859-1这个地方可以多试几个参数
utf-8,GBK,gb2312四:
        public static String charConvert(String strSource){
            if (strSource == null){
                return "";
            }
            else{
                try{
                  //return new String(strSource.getBytes("GB2312"), "ISO-8859-1");
                  String str = new String(strSource.getBytes("ISO-8859-1"), "GB2312");
                  System.out.println(str);
                  return str;
                }
                catch (Exception ex){
                  System.out.println(ex.toString());
                  return "";
                }
            }
        }五:
request.setCharacterEncoding("gb2312");
随便找一个试试,
这些都是搜索到的。

解决方案 »

  1.   

    把代码转换,             byte[] temp_t=strs.getBytes("ISO8859-1");
        String temp=new String(temp_t);
      

  2.   

    caina3(阿郎)的方法挺多得呀!哈哈随便试试吧!写个JavaBean,以后用着也方便!package beans ;
    public class  ISOtoGB2312
    {
    public  String getConvert(String str) 
    {
    try
    {
    byte[] byteStr=str.getBytes("ISO-8859-1");
    return new String(byteStr,"gb2312");
    }
    catch(Exception e)
    {
    return str;
    }
        }
    }