Closed
Description
rexli opened SPR-13881 and commented
When i use @PropertySources
to load my properties file, i found that i can not specify character encoding.
Here is org.springframework.core.io.support.ResourcePropertySource source code:
public ResourcePropertySource(String name, Resource resource) throws IOException {
super(name, PropertiesLoaderUtils.loadProperties(new EncodedResource(resource)));
this.resourceName = getNameForResource(resource);
}
I want to specify character encoding like that:
PropertiesLoaderUtils.loadProperties(new EncodedResource(resource, "UTF-8"))
Affects: 4.1.7
Issue Links:
- Support configurable charset for ResourcePropertySource [SPR-10096] #14729 Support configurable charset for ResourcePropertySource ("duplicates")
- Add support for UTF-8 and other charset/encoding to
@PropertySource
[SPR-13874] #18447 Add support for UTF-8 and other charset/encoding to@PropertySource