字符串16进制打印

String name = "中文";
byte[] gbkbytes = name.getBytes("ISO-8859-1");
for (int i = 0; i < gbkbytes.length; i ++) {
System.out.printf("0x%02X ", gbkbytes[i]);
}
System.out.println();

posted @ 2016-01-13 11:34  刘振明  阅读(2911)  评论(0编辑  收藏  举报