试试
x=new String(s.getBytes("ISO8859_1"),"GBK");

解决方案 »

  1.   

    x=new String(s.getBytes(),"GBK");
      

  2.   

    s=new String(s.getBytes("ISO-8859-1"),"gb2312");
      

  3.   

    各位请先run一下这个:
    public class test {
    public static void main(String[] args) {
    test t=new test();
    t.trans();
    }

    public void log(String s) {
    System.out.println(s);
    }

    private void trans() {
    String[] encode={"UTF8","GBK","gb2312","8859_1"}; 
    String s,x;

    s="鍒犻櫎";
    try {
    for (int i=0;i<encode.length;i++) {
    for (int k=0;k<encode.length;k++) {
    x=new String(s.getBytes(encode[i]),encode[k]);
    log(encode[i]+"\t>\t"+encode[k]+"\t="+x);
    }
    }
    }catch(Exception e){ e.printStackTrace(System.out); }
    }
    }
      

  4.   

    s=new String(s.getBytes("ISO-8859-1"),"gb2312");
    或者是s=new String(s.getBytes("gb2312"),"ISO-8859-1");
    两个换着用,肯定好使,我试过!!
      

  5.   

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!谢谢大家,但问题仍未解决
    请先 run 一下 回复4 的例程。
    request.getProperty(key) 的返回值encoding格式
    似乎是 UTF8,用get方法可以看到是三字节编码!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      

  6.   

    首先确定你的web server编码和jdbc编码。
    这里,我用resin,oracle的class12.jar
    如果你想得到unicode十进制编码,在jsp
    中作如下设置:
    <%@ page contentType="text/html; charset=iso-8859-1"%>
    如果希望得到和系统编码一样的字串,不要设定上面这行。
    只要设定<meta http-equiv="Content-Type" content="text/html; charset=GBK">就可以。欢迎交流。
    [email protected]
      

  7.   

    sss
           !!!
          [===]
           /|\
     
    有请高手降临...
    (我想问题关键是 GBK -> UTF8 转换不完全。)
      

  8.   

    x =new String(s.getBytes("ISO8859_1"),"GBK")