问题,引用百度知道的问题吧:
http://zhidao.baidu.com/question/51342167.html?qbl=relate_question_0&word=ÄãºÃ 乱码
即:出现了以下字符乱码
ÄãºÃ£¬¿Í»§ÉÐÔÚ¿¼ÂÇÖУ¬Ð»Ð»£¡
如何解决?
方法一:
String s_iso88591 = new String("ÄãºÃ£¬¿Í»§ÉÐÔÚ¿¼ÂÇÖУ¬Ð»Ð»£¡ ".getBytes("ISO-8859-1"),"GBK");
输出s_iso88591即可。
方法二:
String testString = "你好";
byte[] hold = testString.getBytes("GBK");
for (int i = 0 ; i < hold.length; i++) {
System.out.println((char)(256 + hold[i]));
}
输出: ÄãºÃ