用UTF8编码读入一个utf8的文件,结果写入输出流的时候还是乱码?这是怎么回事?
InputStream ist = LaucherTest.class.getResourceAsStream("/Book1.csv");
InputStreamReader reader = new InputStreamReader(ist,"UTF-8");
ByteArrayOutputStream str= new ByteArrayOutputStream();
int ch;
while((ch=reader.read())!=-1){
str.write(ch);
}
查看str内容,结果还是乱码 :!:
青春有我
千万里不及你
慕尼黑5688855
相关分类