read settings (json, yml) using utf8

This commit is contained in:
kimchy 2010-02-23 21:33:54 +02:00
parent 46ff97af5e
commit 4cf1b3ed9e
3 changed files with 3 additions and 3 deletions

View File

@ -122,7 +122,7 @@ public class MapperService extends AbstractIndexComponent implements Iterable<Do
if (dynamic) {
try {
dynamicMappingSource = Streams.copyToString(new InputStreamReader(dynamicMappingUrl.openStream(), "UTF8"));
dynamicMappingSource = Streams.copyToString(new InputStreamReader(dynamicMappingUrl.openStream(), "UTF-8"));
} catch (IOException e) {
throw new MapperException("Failed to load default mapping source from [" + dynamicMappingLocation + "]", e);
}

View File

@ -253,7 +253,7 @@ public abstract class Streams {
if (is == null) {
throw new FileNotFoundException("Resource [" + path + "] not found in classpath with class loader [" + classLoader + "]");
}
return copyToString(new InputStreamReader(is));
return copyToString(new InputStreamReader(is, "UTF-8"));
}
public static String copyToStringFromClasspath(String path) throws IOException {

View File

@ -487,7 +487,7 @@ public class ImmutableSettings implements Settings {
public Builder loadFromStream(String resourceName, InputStream is) throws SettingsException {
SettingsLoader settingsLoader = SettingsLoaderFactory.loaderFromResource(resourceName);
try {
Map<String, String> loadedSettings = settingsLoader.load(Streams.copyToString(new InputStreamReader(is)));
Map<String, String> loadedSettings = settingsLoader.load(Streams.copyToString(new InputStreamReader(is, "UTF-8")));
putAll(loadedSettings);
} catch (IOException e) {
throw new SettingsException("Failed to load settings from [" + resourceName + "]");