mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Update FileUtil.readFile to use UTF-8 charset to read files.
This commit is contained in:
@@ -29,6 +29,7 @@ import java.io.OutputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.Reader;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@@ -208,7 +209,8 @@ public final class FileUtil {
|
||||
if ((file == null) || !file.exists()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return FileUtil.readAllLines(new FileReader(file), false);
|
||||
Charset charset = Charset.forName("UTF-8");
|
||||
return FileUtil.readAllLines(new FileReader(file, charset), false);
|
||||
} catch (final Exception ex) {
|
||||
throw new RuntimeException("FileUtil : readFile() error, " + ex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user