Skip to content

ResourcePropertySource class should support to specify character encoding [SPR-13881] #18454

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: duplicateA duplicate of another issuetype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions