Skip to content

Commit

Permalink
fixed encoding problem when generating gm handbook
Browse files Browse the repository at this point in the history
  • Loading branch information
PasserbyAlpha committed Apr 22, 2022
1 parent 7fdeb72 commit 1b39f67
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/emu/grasscutter/tools/Tools.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package emu.grasscutter.tools;

import java.io.FileInputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
Expand Down Expand Up @@ -30,7 +33,7 @@ public static void createGmHandbook() throws Exception {
ResourceLoader.loadResources();

Map<Long, String> map;
try (FileReader fileReader = new FileReader(Utils.toFilePath(Grasscutter.getConfig().RESOURCE_FOLDER + "TextMap/TextMapEN.json"))) {
try (InputStreamReader fileReader = new InputStreamReader(new FileInputStream(Utils.toFilePath(Grasscutter.getConfig().RESOURCE_FOLDER + "TextMap/TextMapEN.json")), StandardCharsets.UTF_8)) {
map = Grasscutter.getGsonFactory().fromJson(fileReader, new TypeToken<Map<Long, String>>() {}.getType());
}

Expand Down

0 comments on commit 1b39f67

Please sign in to comment.