比如:0xBB 0xFA
这个是ASCII编码的16进制,请问怎么转换成中文!谢谢

解决方案 »

  1.   

    import java.io.*;
    public   class   t   { public   static   void   main(String[]   args)   { String   enc   =   System.getProperty("file.encoding"); System.out.println(enc);
    byte[] b={(byte)0xBB,(byte)0xFA};
    String s="";
    try {
    s = new String(b,"GBK");
    System.out.println(s);
        //b=s.getBytes("机");
        //System.out.println(b[0]+" "+b[1]);
    } catch (UnsupportedEncodingException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }

    } }
      

  2.   

    用 String 的 构造函数  new String()