#1265: Ensure UTF-8 used in new test resource

By: Doc <nachito94@msn.com>
This commit is contained in:
CraftBukkit/Spigot
2023-10-01 15:27:41 +11:00
parent 570a4195c0
commit 6e2503b658

View File

@@ -1,6 +1,7 @@
package org.bukkit.craftbukkit.legacy; package org.bukkit.craftbukkit.legacy;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;
import com.google.common.base.Charsets;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
@@ -25,7 +26,7 @@ public class PersistentDataContainerLegacyTest extends AbstractTestingBase {
try (final InputStream input = getClass().getClassLoader().getResourceAsStream("pdc/legacy_pdc.yml")) { try (final InputStream input = getClass().getClassLoader().getResourceAsStream("pdc/legacy_pdc.yml")) {
assertNotNull(input, "Legacy pdc yaml was null"); assertNotNull(input, "Legacy pdc yaml was null");
try (BufferedReader reader = new BufferedReader(new InputStreamReader(input))) { try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, Charsets.UTF_8))) {
legacyConfig = YamlConfiguration.loadConfiguration(reader); legacyConfig = YamlConfiguration.loadConfiguration(reader);
} }
} catch (IOException e) { } catch (IOException e) {