out.println(rs1.getString("username"));
不需要转换

解决方案 »

  1.   

    out.println(rs1.getString("username").getBytes("ISO8859_1"));//这里显示几个问号这个地方不需要转换
      

  2.   

    你查看一下你的 access库里面的是不是乱码!
      

  3.   

    还有记得写上
    <%@page conentType="text/html;charset=gb2312"%>
      

  4.   

    <%@page contentType="text/html;charset=gb2312"%>
    写错了。
    晕,我怎么象灌水的?!
      

  5.   

    access里不是乱码?真的好奇怪。我在开头加了<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
      

  6.   

    谢谢  rainshow(要学习的那样多,时间却那么的少) 现在可以了
    难道 <meta http-equiv="Content-Type" content="text/html;charset=gb2312">

    <%@page contentType="text/html;charset=gb2312"%>
    不是一样的吗?
    能否解释一下
      

  7.   

    恩,再 bean里加上代码转化程序:
     public  static String  UnicodeToChinese(String  s){
         try
         {
            if(s==null||s.equals("")) return "";
             String  newstring=null;
             newstring=new  String(s.getBytes("ISO8859_1"),"gb2312");
             return  newstring;
          }
         catch(Exception  e)
         {
           return  s;
         }
       }  public  static  String  ChineseToUnicode(String  s){
         try
         {
          if(s==null||s.equals(""))  return  "";
          String  newstring=null;
          newstring=new  String(s.getBytes("gb2312"),"ISO8859_1");
          return  newstring;
         }
        catch(Exception  e)
          {
            return  s;
          }
      }
    然后再jsp调用
      

  8.   

    记住:要存入数据库的时候chinesetounicode,调用的时候再unicodetochinese
      

  9.   

    记住了!!谢谢ccccffff(长江流域)