对文件操作中文乱码

public static void writeFile(File file,String context) throws IOException{
OutputStreamWriter write = new OutputStreamWriter(
new FileOutputStream(file, true), "utf-8");
BufferedWriter bw = new BufferedWriter(write);
bw.write(context);
bw.close();
}


用以上方法可解决,权做记录。

你可能感兴趣的:(中文乱码,文件)