已知String s;
1. 把String转换成数组:
Byte[] a = s.getBytes("iso-8859-1");
2.把字节数组转换成String:
String str = new String(a,"gbk");
3.综上:把原本中文乱码转换为中文:
String string = new String(s.getBytes("iso-8859-1"),"gbk");