getBytes('2312'),'utf-8'不知道能不能....

解决方案 »

  1.   

    try{message=URLEncoder.encode(message,"utf-8");}catch(Exception e){}
      

  2.   

    String text;
    byte[] b1 = text.getBytes("ISO8859-1");
    text = new String(b1, "GB2312");这样就可以了,其它类似
    是我程序里面的一段,是可用的
      

  3.   

    string s = new String(text.getByte("gb2312"),"ISO8859-1");
      

  4.   

    各位的办法不灵。我得到的数据是从.txt文件中读取的。
    而且文件用的是ANSI格式保存的,我需要把它转换成UTF—8格式。
      

  5.   

    按上面的方法getbyte从ansi--->iso8859-1后再URLEncoder.encode