Explicitly use UTF-8 when scanning file for YAML comments

Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1372
This commit is contained in:
tastybento 2020-05-27 16:32:20 -07:00
parent 7b28c67db0
commit 0e10563ae6

View File

@ -144,7 +144,7 @@ public class YamlDatabaseConnector implements DatabaseConnector {
// Run through the file and add in the comments
File commentedFile = new File(file.getPath() + ".tmp");
List<String> newFile = new ArrayList<>();
try (Scanner scanner = new Scanner(file)) {
try (Scanner scanner = new Scanner(file, "UTF-8")) {
while (scanner.hasNextLine()) {
String nextLine = scanner.nextLine();
// See if there are any comments in this line