read settings (json, yml) using utf8
This commit is contained in:
parent
46ff97af5e
commit
4cf1b3ed9e
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 + "]");
|
||||
|
|
Loading…
Reference in New Issue