1: The solution to the garbled code in reading Chinese:
add the encoding mode “UTF-8” when constructing the inputstreamreader
BufferedReader br = new BufferedReader(new InputStreamReader(
new FileInputStream(new File("F:/download/test.txt")),"utf-8"))
2: When using filewriter to write a file, you must add
fw.flush();
To write successfully.