Skip to content

Support configurable charset for ResourcePropertySource [SPR-10096] #14729

Closed
@spring-projects-issues

Description

@spring-projects-issues

Sebastien Lorber opened SPR-10096 and commented

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.


Affects: 3.1.2

Issue Links:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions