diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-03-23 13:26:12 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-03-23 13:26:12 +0000 |
commit | 97c07ff20ae96db19f947d61c16398531e3ea668 (patch) | |
tree | 29ade0b3e2272a80558036784ab7aff46c0c090f | |
parent | eb92819e361cceff0ab391c5d65150e4af639fa9 (diff) | |
parent | 895b2bd0672bafa8a5fb65d4a7dd6a9104ff250d (diff) | |
download | Essentials-97c07ff20ae96db19f947d61c16398531e3ea668.tar Essentials-97c07ff20ae96db19f947d61c16398531e3ea668.tar.gz Essentials-97c07ff20ae96db19f947d61c16398531e3ea668.tar.lz Essentials-97c07ff20ae96db19f947d61c16398531e3ea668.tar.xz Essentials-97c07ff20ae96db19f947d61c16398531e3ea668.zip |
Merge branch 'master' of github.com:essentials/Essentials
-rw-r--r-- | Essentials/src/com/earth2me/essentials/EssentialsConf.java | 16 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/I18n.java | 1 |
2 files changed, 10 insertions, 7 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsConf.java b/Essentials/src/com/earth2me/essentials/EssentialsConf.java index 846a7b4b0..89fb53d34 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsConf.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsConf.java @@ -126,23 +126,25 @@ public class EssentialsConf extends YamlConfiguration { buffer.rewind(); data.clear(); - LOGGER.log(Level.INFO, "File {0} is not utf-8 encoded, trying {1}", new Object[] - { - configFile.getAbsolutePath().toString(), Charset.defaultCharset().displayName() - }); + LOGGER.log(Level.INFO, "File " + configFile.getAbsolutePath().toString() + "is not utf-8 encoded, trying " + Charset.defaultCharset().displayName()); decoder = Charset.defaultCharset().newDecoder(); result = decoder.decode(buffer, data, true); if (result.isError()) { throw new InvalidConfigurationException("Invalid Characters in file " + configFile.getAbsolutePath().toString()); - } else { + } + else + { decoder.flush(data); } - } else { + } + else + { decoder.flush(data); } + final int end = data.position(); data.rewind(); - super.loadFromString(data.toString()); + super.loadFromString(data.subSequence(0, end).toString()); } finally { diff --git a/Essentials/src/com/earth2me/essentials/I18n.java b/Essentials/src/com/earth2me/essentials/I18n.java index 63fdcc065..97d500a6a 100644 --- a/Essentials/src/com/earth2me/essentials/I18n.java +++ b/Essentials/src/com/earth2me/essentials/I18n.java @@ -114,6 +114,7 @@ public class I18n implements II18n { currentLocale = new Locale(parts[0], parts[1], parts[2]); } + ResourceBundle.clearCache(); Logger.getLogger("Minecraft").log(Level.INFO, String.format("Using locale %s", currentLocale.toString())); customBundle = ResourceBundle.getBundle(MESSAGES, currentLocale, new FileResClassLoader(I18n.class.getClassLoader(), ess)); localeBundle = ResourceBundle.getBundle(MESSAGES, currentLocale); |