mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-23 16:16:46 +00:00
use OutputStreamWriter to ensure the charset of output is utf8 [from fumbling644o]
This commit is contained in:
parent
1b39f67032
commit
2750d5da2d
@ -1,9 +1,11 @@
|
||||
package emu.grasscutter.tools;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.PrintWriter;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.LocalDateTime;
|
||||
@ -39,7 +41,7 @@ public final class Tools {
|
||||
|
||||
List<Integer> list;
|
||||
String fileName = "./GM Handbook.txt";
|
||||
try (FileWriter fileWriter = new FileWriter(fileName); PrintWriter writer = new PrintWriter(fileWriter)) {
|
||||
try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(fileName), StandardCharsets.UTF_8), false)) {
|
||||
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user