You need to use OutputStreamWriter
so you can specify an output charset. You can then wrap that in a PrintWriter
or BufferedWriter
if you need printing semantics:
PrintWriter kitaba1 = null;
try {
kitaba1 = new PrintWriter(new OutputStreamWriter(new FileOutputStream(new File(ismmilaf), true), StandardCharsets.UTF_8));
} catch (FileNotFoundException ex) {
ex.printStackTrace();
}
//kitaba1.println(moarif1);
kitaba1.close();
BufferedWriter kitaba1 = null;
try {
kitaba1 = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(ismmilaf), true), StandardCharsets.UTF_8));
} catch (FileNotFoundException ex) {
ex.printStackTrace();
}
//kitaba1.write(moarif1);
//kitaba1.newLine()
kitaba1.close();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…