没有这样的方法,只能自己写!

解决方案 »

  1.   

    很多书上都有的,给你一个
    //========================= MyUtil.java ======================
    import java.io.*;
    public class MyUtil
      {
     public static String big5ToUnicode(String s)
        {
        try
          {
          return new String(s.getBytes("ISO8859_1"), "Big5");
          }
        catch (UnsupportedEncodingException uee)
          {
          return s;
          }
        }
    public static String unicodeToBig5(String s)
        {
        try
          {
          return new String(s.getBytes("Big5"), "ISO8859_1");
          }
        catch (UnsupportedEncodingException uee)
          {
          return s;
          }
        }
    public static String toHexString(String s)
        {
        String str="";
        for (int i=0; i<s.length(); i++)
          {
          int ch=(int)s.charAt(i);
          String s4="0000"+Integer.toHexString(ch);
          str=str+s4.substring(s4.length()-4)+" ";
          }
        return str;
        }
      }