MultiByteToWidechar
WidecharToMultiByte

解决方案 »

  1.   

    bwsabc(javavaj)  你的方法好像不行吧?
    请明示
      

  2.   

    为什么我打印出来的是 负数 呢?程序如下:byte[] b = "王".getBytes();
    for(int i = 0 ; i < b.length ; i++){
        System.out.println("   " + b[i]);
    }结果如下:   -51
       -11
      

  3.   

    String s = "汉字";
            System.out.println("\\u" + Integer.toHexString(s.charAt(0)) +"\\u"+Integer.toHexString(s.charAt(1)));
            System.out.println("\u6c49\u5b57");
      

  4.   

    String str = "王";
    try
    {
    byte[] by = str.getBytes("GBK");
    int i = by[0];
    i=i<<8;
    i+=by[1];
    System.out.println(Integer.toHexString(i));
    }
    catch(Exception e)
    {
    e.printStackTrace();
    }
      

  5.   

    System.out.println(Integer.toHexString("王".charAt(0)));