Skip to content

org.springframework.beans.propertyeditors.URIEditor does double escaping for % signes for URIs that contain a schema [SPR-6005] #10673

Closed
@spring-projects-issues

Description

@spring-projects-issues

Andreas Hartl opened SPR-6005 and commented

org.springframework.beans.propertyeditors.URIEditor does a double escaping of URLs with a schema that use % escaping.

Test:

System.out.println(new SimpleTypeConverter().convertIfNecessary("http://de.wikipedia.org/wiki/%C3%96", URI.class));

prints

http://de.wikipedia.org/wiki/%25C3%2596

I ran into this behavior when I wanted to make use of URIEditor's feature that it can resolve classpath: URLs. If the classpath contains spaces or other characters that need to be escaped in URLs, then the resulting URI contains double escaped % signs.

My current workaround is to extend URIEditor and override createURI to always return new URI(value). when registered as custom editor for URIs, this PropertyEditor returns the proper URI.


Affects: 3.0 M3

Attachments:

Issue Links:

Referenced from: commits 7ec9f15

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions