测试如下:
try{
byte[] arg1 = new byte[]{(byte)96, (byte)0, (byte)3, (byte)63, (byte)63, (byte)-36,
(byte)-9, (byte)63, (byte)63,(byte)63, (byte)63, (byte)63, (byte)63,(byte)-49, (byte)-2,
(byte)0, (byte)0, (byte)0, (byte)0, (byte)0,(byte) 0, (byte)0};
byte[] arg2 = new byte[]{(byte)96, (byte)0, (byte)3, (byte)-32, (byte)-1, (byte)-36,
(byte)-9, (byte)-1, (byte)-1,(byte)-1, (byte)-1, (byte)-2, (byte)-1,(byte) (byte)-49, (byte)-2,
(byte)0, (byte)0,(byte)0, (byte)0, (byte)0,(byte) 0, (byte)0};
System.out.println("arg1 =:" + new String(arg1,"GB2312"));
System.out.println("arg2 =:" + new String(arg1,"GB2312"));
String arg3 = new String(arg1,"GB2312");
byte[] a1 = a.getBytes("GB2312");
System.out.println("输入出的byte:");
for (int i = 0; i < a1.length; i++) {
System.out.print(a1[i]+",");
}
} catch (Exception e) {
e.printStackTrace();
}
最终输出的结果如下:
请问为什么会出现这种情况??