你用
byte[] strAsByte;
String str = new String(strAsByte,"GB2312");
试试
或者
byte[] strAsByte;
String str = new String(strAsByte,"ISO-8859");
另外你去的数据流的时候最好用字节流别用字符流(就是最好用Stream,而不要用Reader或Writer)
byte[] strAsByte;
String str = new String(strAsByte,"GB2312");
试试
或者
byte[] strAsByte;
String str = new String(strAsByte,"ISO-8859");
另外你去的数据流的时候最好用字节流别用字符流(就是最好用Stream,而不要用Reader或Writer)
String str = new String(strAsByte,"GB2312");
或者
byte[] strAsByte;
String str = new String(strAsByte,"GBK");
或者
byte[] strAsByte;
String str = new String(strAsByte,"ISO-8859-1");
可以打出前几个byte看看是否跟c++编码时的byte一样
如果一样,那么在java这边构造回字符串时用:new String(String str, String encoding);是没有问题的!!!
String ab = new String(byte[],"UnicodeLittleUned");