首页 > 程序开发 > 移动开发 > Android >

android写文件不会乱码的方法

2011-03-22

String filePath = "/sdcard/utf8_file.txt";String UTF8 = "utf8";int BUFFER_SIZE = 8192; BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(filePath), UTF8),BUFFER_SIZE);BufferedWriter bw = n

String filePath = "/sdcard/utf8_file.txt";
String UTF8 = "utf8";
int BUFFER_SIZE = 8192;

BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(filePath), UTF8),BUFFER_SIZE);
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filePath), UTF8),BUFFER_SIZE);

相关文章
最新文章
热点推荐