diff --git a/src/main/java/net/knarcraft/permissionsigns/utility/FileHelper.java b/src/main/java/net/knarcraft/permissionsigns/utility/FileHelper.java index 1eb5fb4..d479374 100644 --- a/src/main/java/net/knarcraft/permissionsigns/utility/FileHelper.java +++ b/src/main/java/net/knarcraft/permissionsigns/utility/FileHelper.java @@ -4,6 +4,8 @@ import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.InputStream; import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; +import java.nio.charset.StandardCharsets; /** * A helper class for dealing with files @@ -16,12 +18,12 @@ public class FileHelper { * @return

A buffered read for reading the file

* @throws FileNotFoundException

If unable to get an input stream for the given file

*/ - public static BufferedReader getBufferedReaderForInternalFile(String file) throws FileNotFoundException { + public static BufferedReader getBufferedReaderForInternalFile(String file) throws FileNotFoundException, UnsupportedEncodingException { InputStream inputStream = FileHelper.class.getResourceAsStream(file); if (inputStream == null) { throw new FileNotFoundException("Unable to read the given file"); } - return new BufferedReader(new InputStreamReader(inputStream)); + return new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); } }