You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support configurable charset for ResourcePropertySource [SPR-10096] #14729
In org.springframework.core.io.support.ResourcePropertySource#loadPropertiesForResource
The properties are loaded with:
InputStream is = resource.getInputStream();
props.load(is);
While there should be loaded with:
InputStream is = resource.getInputStream();
InputStreamReader reader = new InputStreamReader(is,charset);
props.load(reader);
And the charset could be added to the constructors, why not with a default UTF-8 charset.
Without that, all property sources loaded with this class are using ISO 8859-1 charset
It seems to affect 3.2 as well because I didn't see any charset in the constructor.
I've added overloaded constructors with an EncodedResource argument (basically a combination of a Resource with an encoding/charset) to ResourcePropertySource for the upcoming 3.2.1 release.
Activity
spring-projects-issues commentedon Dec 18, 2012
Chris Beams commented
Good point Sebastien, thanks!
spring-projects-issues commentedon Jan 22, 2013
Chris Beams commented
This is not quite as trivial as I thought it might be on initial review. Slating for 3.2 Backlog.
spring-projects-issues commentedon Jan 22, 2013
Sebastien Lorber commented
My implementation is trivial and it seems to work fine for us (at least with UTF-8)
What is the matter?
spring-projects-issues commentedon Jan 23, 2013
Juergen Hoeller commented
I've added overloaded constructors with an EncodedResource argument (basically a combination of a Resource with an encoding/charset) to ResourcePropertySource for the upcoming 3.2.1 release.
Juergen