2013年6月9日

将字符串转换成GB2312编码格式

摘要: /** * 将一个原来给定的String,转换成对应的gb2312编码的char[]; * * @param instr * @return */ public static char[] toGB2312(String instr) { try { byte temp[] = instr.getBytes("GB2312"); // 将instr转换成一个gb2312编码的byte[] char ret[] = new char[temp.length + 1]; int i = 0; for (i = 0; i < temp.length; i++) { ... 阅读全文

posted @ 2013-06-09 10:41 ywf—java 阅读(1166) 评论(0) 推荐(0)

导航