From 6ad26cc8fad8d264d176c404cd3931153eb5753d Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 24 Feb 2020 10:10:27 +1100 Subject: [PATCH] #2777: Write BungeeCord's config.yml in UTF-8 as with main config API --- proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java index bc7e3a0d..c0620445 100644 --- a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java +++ b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java @@ -1,11 +1,14 @@ package net.md_5.bungee.conf; +import com.google.common.base.Charsets; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.File; import java.io.FileInputStream; -import java.io.FileWriter; +import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; import java.net.SocketAddress; import java.util.ArrayList; import java.util.Arrays; @@ -173,7 +176,7 @@ public class YamlConfig implements ConfigurationAdapter { try { - try ( FileWriter wr = new FileWriter( file ) ) + try ( Writer wr = new OutputStreamWriter( new FileOutputStream( file ), Charsets.UTF_8 ) ) { yaml.dump( config, wr ); }