可能是SQLServerDriver驱动的问题,我也遇到过这种情况
如果你取出来的是乱码用这个函数:
private String from_iso8859(String source)

if(source==null) return "";
try {
String s = new String(source.getBytes("iso-8859-1"));
return s;
} catch (java.lang.Exception e){
return null;
}
}

解决方案 »

  1.   

    中文问题的确多啊,加上
    private String from_iso8859(String aaa)

    if(aaa==null) return "";
    try {
    String s = new String(aaa.getBytes("iso-8859-1"));
    return s;
    } catch (java.lang.Exception e){
    return null;
    }
    }
    试试。
      

  2.   

    ss=new String(rs.getString(1).getBytes("ISO-8859-1"),"GB2312");---------------------------------------------------
    <%!
    public String getStr(String str)
    {
    try
    {
    String temp_p=str;
    byte[] temp_t=temp_p.getBytes("GBK");
    String temp=new String(temp_t,"ISO8859_1");
    return temp;
    }
    catch(Exception e)
    {}
    return "null";
    }
    -----------------------------------------------------------
    <%!
    public String getGB(String str){
      try{
        return new String(str.getBytes("ISO8859-1"));
      }
      catch{
        return "null";
      }
    }
    %>
    --------------------------------------------------------------
    接分了~!!!