日期:2014-05-20 浏览次数:21075 次
String s = "秋"; byte[] b = s.getBytes("gbk"); for(int i=0; i<b.length; i++) { System.out.println(b[i]); }
String s = "秋"; byte[] b = s.getBytes("gbk"); for (int i = 0; i < b.length; i++) { System.out.println(Integer.toHexString(b[i]&0xFF)); System.out.println(Integer.toBinaryString(b[i]&0xFF)); } 输出: c7 11000111 //-57的二进制补码 ef 11101111