09-09
15
java文件读取 编码方式设置
作者:Java伴侣 日期:2009-09-15
Java代码
Java代码
复制内容到剪贴板 程序代码
FileInputStream fr = new FileInputStream(path);
InputStreamReader is = new InputStreamReader(fr,"UTF-8");
BufferedReader br=new BufferedReader(is);
FileInputStream fr = new FileInputStream(path);
InputStreamReader is = new InputStreamReader(fr,"UTF-8");
BufferedReader br=new BufferedReader(is);
InputStreamReader is = new InputStreamReader(fr,"UTF-8");
BufferedReader br=new BufferedReader(is);
FileInputStream fr = new FileInputStream(path);
InputStreamReader is = new InputStreamReader(fr,"UTF-8");
BufferedReader br=new BufferedReader(is);
Java代码
复制内容到剪贴板 程序代码
FileOutputStream stream;// provides file access
OutputStreamWriter writer;// writes to the file
try {
stream = new FileOutputStream(filename);
writer = new OutputStreamWriter(stream,"UTF-8");
OutputStreamWriter writer;// writes to the file
try {
stream = new FileOutputStream(filename);
writer = new OutputStreamWriter(stream,"UTF-8");
评论: 0 | 引用: 0 | 查看次数: 293
发表评论