Force loading help-text using utf-8 to fix encoding errors (#4165)

This commit is contained in:
rtm516 2023-09-30 22:18:57 +01:00 committed by GitHub
parent 5d30019bc7
commit 1d75d084a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,6 +28,7 @@ package org.geysermc.geyser;
import javax.swing.*;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.nio.charset.StandardCharsets;
import java.util.Locale;
import java.util.Scanner;
@ -60,7 +61,7 @@ public class GeyserMain {
helpStream = GeyserMain.class.getClassLoader().getResourceAsStream("languages/run-help/en_US.txt");
}
Scanner help = new Scanner(helpStream).useDelimiter("\\Z");
Scanner help = new Scanner(helpStream, StandardCharsets.UTF_8).useDelimiter("\\Z");
String line = "";
while (help.hasNext()) {
line = help.next();