summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunfighterJ <joseph.jenniges@gmail.com>2013-06-30 07:40:24 -0500
committerGunfighterJ <joseph.jenniges@gmail.com>2013-06-30 07:40:24 -0500
commit32426aa540c166720e59bbbceb89efad3a2598f5 (patch)
treed90c98dfea808977b0a6e354c05109cadd627834
parent6808b03febca07ca053a8a5566e0712d66bec59e (diff)
downloadEssentials-32426aa540c166720e59bbbceb89efad3a2598f5.tar
Essentials-32426aa540c166720e59bbbceb89efad3a2598f5.tar.gz
Essentials-32426aa540c166720e59bbbceb89efad3a2598f5.tar.lz
Essentials-32426aa540c166720e59bbbceb89efad3a2598f5.tar.xz
Essentials-32426aa540c166720e59bbbceb89efad3a2598f5.zip
Force reading in UTF-8 from .txt files
-rw-r--r--Essentials/src/com/earth2me/essentials/textreader/BookInput.java3
-rw-r--r--Essentials/src/com/earth2me/essentials/textreader/TextInput.java3
2 files changed, 4 insertions, 2 deletions
diff --git a/Essentials/src/com/earth2me/essentials/textreader/BookInput.java b/Essentials/src/com/earth2me/essentials/textreader/BookInput.java
index b0fedbf86..f4477aa3c 100644
--- a/Essentials/src/com/earth2me/essentials/textreader/BookInput.java
+++ b/Essentials/src/com/earth2me/essentials/textreader/BookInput.java
@@ -80,7 +80,8 @@ public class BookInput implements IText
}
if (readFromfile)
{
- final BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
+ final Reader reader = new InputStreamReader(new FileInputStream(file), "utf-8");
+ final BufferedReader bufferedReader = new BufferedReader(reader);
try
{
int lineNumber = 0;
diff --git a/Essentials/src/com/earth2me/essentials/textreader/TextInput.java b/Essentials/src/com/earth2me/essentials/textreader/TextInput.java
index cd7ee6ec4..1ea2f6a01 100644
--- a/Essentials/src/com/earth2me/essentials/textreader/TextInput.java
+++ b/Essentials/src/com/earth2me/essentials/textreader/TextInput.java
@@ -61,7 +61,8 @@ public class TextInput implements IText
}
if (readFromfile)
{
- final BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
+ final Reader reader = new InputStreamReader(new FileInputStream(file), "utf-8");
+ final BufferedReader bufferedReader = new BufferedReader(reader);
try
{
int lineNumber = 0;