@Override public ResourceBundle call() throws Exception { return ResourceBundle.getBundle(BUNDLE_LOCATION, locale, new UTF8Control()); } });
public ResourceBundle newBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload) throws IllegalAccessException, InstantiationException, IOException { // The below is a copy of the default implementation. String bundleName = toBundleName(baseName, locale); String resourceName = toResourceName(bundleName, "properties"); ResourceBundle bundle = null; InputStream stream = (reload) ? reload(loader.getResource(resourceName)) : loader .getResourceAsStream(resourceName); if (stream != null) { try { // Only this line is changed to make it to read properties files // as UTF-8. bundle = new PropertyResourceBundle(new InputStreamReader(stream, "UTF-8")); } finally { stream.close(); } } return bundle; }
public ResourceBundle newBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload) throws IllegalAccessException, InstantiationException, IOException { // The below is a copy of the default implementation. String bundleName = toBundleName(baseName, locale); String resourceName = toResourceName(bundleName, "properties"); ResourceBundle bundle = null; InputStream stream = (reload) ? reload(loader.getResource(resourceName)) : loader .getResourceAsStream(resourceName); if (stream != null) { try { // Only this line is changed to make it to read properties files // as UTF-8. bundle = new PropertyResourceBundle(new InputStreamReader(stream, "UTF-8")); } finally { stream.close(); } } return bundle; }
@Override public ResourceBundle call() throws Exception { return ResourceBundle.getBundle(BUNDLE_LOCATION, locale, new UTF8Control()); } });