我有一个函数可以将一些数据写入文件。
{
Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("E:\\Code\\ParseTool\\src\\ketqua.txt"), "Unicode"));
System.out.print("{\"q\":\"" + ques + "\",\"a\":\"" + ans + "\"},");
out.write("{\"q\":\"" + ques + "\",\"a\":\"" + ans + "\"},\n");
}
当我写入控制台时:数据看起来正确:
{"q":" ��Which of the following methods is defined by the JSP engi....
但是当在txt文件中写入的数据是自动添加空格字符
时 {"q":" ��W h i c h o f t h e f o l l o w i n g m e t h o d s i s d e f i n e d b y t h e J S P e n g i n e ? ","a":" A n s w e r :
有人帮忙......