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

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2295 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Arjen Poutsma
2009-11-09 09:15:49 +00:00
parent 2b1b7d03be
commit 27d3926a16
2 changed files with 47 additions and 3 deletions
@@ -130,4 +130,15 @@ public class URIEditorTests {
assertEquals("http://example.com/spaces%20and%20%E2%82%AC", uri.toASCIIString());
}
@Test
public void encodeAlreadyEncodedURI() throws Exception {
PropertyEditor uriEditor = new URIEditor(false);
uriEditor.setAsText("http://example.com/spaces%20and%20%E2%82%AC");
Object value = uriEditor.getValue();
assertTrue(value instanceof URI);
URI uri = (URI) value;
assertEquals(uri.toString(), uriEditor.getAsText());
assertEquals("http://example.com/spaces%20and%20%E2%82%AC", uri.toASCIIString());
}
}