out.println(new ( (new String("我爱死你了")).getBytes"GBK"),"ISO8859_1"))

解决方案 »

  1.   

    楼上的是将gbk转换成iso-8859-1,如果说要把iso-8859-1转换成gbk刚如下String str1="我爱死你了";
    String str2=new String(str1.getBytes("iso-8859-1"),"gbk");
    out.print(str2);
      

  2.   

    如果是out.println()寫在jsp裏面,resin不可能有中文問題,根本不需要編碼,只需加這句<%@ page contentType="text/html; charset=GBK" %>
    就行了,resin的好處也就在這裡。或者你應該把問題詳細化一點
      

  3.   

    resin的默认编码就是 ISO-8859-1的,所以你只要设定<%@ page contentType="text/html; charset=GBK" %>
    或者用getBytes进行转换。
    具体请看:
    http://www.csdn.net/expert/topic/654/654452.xml?temp=.958111