Skip to content

Properties should be now in UTF-8 #29587

Closed
@pdemanget

Description

@pdemanget

Since java 9, properties should be in UTF-8 unless specifically configured else:
https://docs.oracle.com/javase/9/intl/internationalization-enhancements-jdk-9.htm#JSINT-GUID-974CF488-23E8-4963-A322-82006A7A14C7

The properties Loader still user ISO hardcoded, see this file:
https://github.com/spring-projects/spring-boot/blob/main/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/OriginTrackedPropertiesLoader.java

        CharacterReader(Resource resource) throws IOException {
		this.reader = new LineNumberReader(
				new InputStreamReader(resource.getInputStream(), StandardCharsets.ISO_8859_1));
	}

Would it be possible to use UTF_8 be default?
It would still be configurable sith the environment var
java.util.PropertyResourceBundle.encoding=ISO-8859-1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions