Android 中文乱码问题
public void readTxt(){ByteArrayBuffer sb = new ByteArrayBuffer(5000);try {InputStream ip = asset.open("aa.txt");BufferedReader br = new BufferedReader(new InputStreamReader(ip,"GB2312"));String temp = null;int cur =0;// while((temp = br.readLine())!=null){// sb.append(temp);// }while((cur = br.read())!=-1){sb.append(cur);}textView.setText( EncodingUtils.getString(sb.toByteArray(),"GB2312")); } catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}
?