mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-22 20:03:21 +00:00
Changed charset of FileReader in ConfigContainer from default to utf-8.
This commit is contained in:
parent
66dadece8a
commit
f3baa0b8e7
@ -5,6 +5,7 @@ import emu.grasscutter.Grasscutter;
|
|||||||
import emu.grasscutter.Grasscutter.ServerDebugMode;
|
import emu.grasscutter.Grasscutter.ServerDebugMode;
|
||||||
import emu.grasscutter.Grasscutter.ServerRunMode;
|
import emu.grasscutter.Grasscutter.ServerRunMode;
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.io.FileReader;
|
import java.io.FileReader;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
@ -27,7 +28,7 @@ public class ConfigContainer {
|
|||||||
public static void updateConfig() {
|
public static void updateConfig() {
|
||||||
try { // Check if the server is using a legacy config.
|
try { // Check if the server is using a legacy config.
|
||||||
JsonObject configObject = Grasscutter.getGsonFactory()
|
JsonObject configObject = Grasscutter.getGsonFactory()
|
||||||
.fromJson(new FileReader(Grasscutter.configFile), JsonObject.class);
|
.fromJson(new FileReader(Grasscutter.configFile, StandardCharsets.UTF_8), JsonObject.class);
|
||||||
if (!configObject.has("version")) {
|
if (!configObject.has("version")) {
|
||||||
Grasscutter.getLogger().info("Updating legacy ..");
|
Grasscutter.getLogger().info("Updating legacy ..");
|
||||||
Grasscutter.saveConfig(null);
|
Grasscutter.saveConfig(null);
|
||||||
|
Loading…
Reference in New Issue
Block a user