Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class UTF8Control extends Control {
- public UTF8Control() {
- }
- public ResourceBundle newBundle(File baseName, Locale locale)
- throws IllegalAccessException, InstantiationException, IOException {
- String bundleName = toBundleName(baseName.getName(), locale);
- String resourceName = toResourceName(bundleName, "properties");
- ResourceBundle bundle = null;
- InputStream stream = new FileInputStream(baseName);
- try {
- // UTF-8.
- bundle = new PropertyResourceBundle(new InputStreamReader(stream, "UTF-8"));
- } finally {
- stream.close();
- }
- return bundle;
- }
- }
- CALLED BY:
- UTF8Control control = new UTF8Control();
- ResourceBundle en = control.newBundle(File, Locale.ENGLISH);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement