System.out.println("中".getBytes("utf-8").length);
for(byte b:"中".getBytes("utf-8")){
System.out.println(b);
}
System.out.println("中".getBytes("gb2312").length);
for(byte b:"中".getBytes("gb2312")){
System.out.println(b);
}
System.out.println("中".getBytes().length);
for(byte b:"中".getBytes()){
System.out.println(b);
}
/*3
-28
-72
-83
2
-42
-48
2
-42
-48*/
/**
* 中文用utf-8存占用32个字节,用gb2312存占2个字节
*/