diff --git a/src/main/java/team/ebi/epicbanitem/EBITranslation.java b/src/main/java/team/ebi/epicbanitem/EBITranslation.java index af2c89d..7cc0e36 100644 --- a/src/main/java/team/ebi/epicbanitem/EBITranslation.java +++ b/src/main/java/team/ebi/epicbanitem/EBITranslation.java @@ -7,6 +7,8 @@ import java.io.IOException; import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.Map; @@ -75,7 +77,7 @@ private void loadExternal() throws IOException { .forEach(it -> { try { final var properties = new Properties(); - properties.load(Files.newInputStream(it)); + properties.load(new InputStreamReader(Files.newInputStream(it), StandardCharsets.UTF_8)); externalProperties.put(it, properties); } catch (IOException e) { throw new RuntimeException(e); @@ -94,7 +96,7 @@ public void removeExternal(String key) { public void saveExternal() { externalProperties.forEach((path, properties) -> { try { - properties.store(Files.newOutputStream(path), null); + properties.store(new OutputStreamWriter(Files.newOutputStream(path), StandardCharsets.UTF_8), null); } catch (IOException e) { throw new RuntimeException(e); } @@ -116,7 +118,8 @@ public void loadMessages() { final var name = path.name(); final var resource = contents.requireResource(PackType.server(), path); final var locale = name.substring(9, name.lastIndexOf(".properties")); - var bundle = new PropertyResourceBundle(new InputStreamReader(resource.inputStream())); + var bundle = new PropertyResourceBundle( + new InputStreamReader(resource.inputStream(), StandardCharsets.UTF_8)); final var external = messagesDir.resolve(name); if (Files.notExists(external)) Files.createFile(external); try (final var reader = Files.newBufferedReader(external)) {