level 1
zengdefu
楼主
我好不容易才找到方法了,相信大家对这个一样头疼.在网是找到了以下处理函数,入参是有问题的字符串,出参就是正常的字符串了.String parseChinese(String in) { String s = null; byte temp []; if (in == null) { System.out.println("Warn:Chinese null founded!"); return new String(""); } try { temp=in.getBytes("iso-8859-1"); temp=in.getBytes("iso-8859-1"); s = new String(temp); } catch(Exception e) { System.out.println("Warn:Chinese null founded!"); return new String(""); } try { temp=in.getBytes("iso-8859-1"); s = new String(temp); } catch(UnsupportedEncodingException e) { System.out.println (e.toString()); } return s; }
2004年08月24日 08点08分
1