From cd83bbb67df6a3341b6a9e770df028a7fd1254ea Mon Sep 17 00:00:00 2001 From: xinyuan liu Date: Mon, 27 Jul 2020 17:13:23 +0800 Subject: [PATCH] Use UTF-8 to decode EVERYTHING! --- .../wizardry/client/gui/handbook/GuiWizardHandbook.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/electroblob/wizardry/client/gui/handbook/GuiWizardHandbook.java b/src/main/java/electroblob/wizardry/client/gui/handbook/GuiWizardHandbook.java index 13fa335f..14b9e7bf 100644 --- a/src/main/java/electroblob/wizardry/client/gui/handbook/GuiWizardHandbook.java +++ b/src/main/java/electroblob/wizardry/client/gui/handbook/GuiWizardHandbook.java @@ -34,6 +34,7 @@ import java.io.IOException; import java.io.InputStreamReader; import java.util.List; import java.util.*; +import java.nio.charset.StandardCharsets; /** * GUI class for the wizard's handbook. Like any GUI class, this is instantiated each time the book is opened. As of @@ -409,7 +410,7 @@ public class GuiWizardHandbook extends GuiScreen { bookmarkSection = null; // Also need to wipe the reference to the old bookmarked section - BufferedReader reader = new BufferedReader(new InputStreamReader(handbookFile.getInputStream())); + BufferedReader reader = new BufferedReader(new InputStreamReader(handbookFile.getInputStream(), StandardCharsets.UTF_8)); JsonElement je = gson.fromJson(reader, JsonElement.class); JsonObject json = je.getAsJsonObject(); @@ -561,4 +562,4 @@ public class GuiWizardHandbook extends GuiScreen { sections.values().forEach(s -> s.updateUnlockStatus(showToasts, completedAdvancements)); } -} \ No newline at end of file +}