SPR-7107 - RestTemplate/UriTemplate/UriUtils improperly encoding UTF-8

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3281 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Arjen Poutsma 2010-04-21 07:55:56 +00:00
parent 668a25efa3
commit c0dd3a83fc
2 changed files with 5 additions and 0 deletions

View File

@ -169,6 +169,9 @@ public class RestTemplateIntegrationTests {
result = template.getForObject(URI + "/uri/query={query}", String.class, "foo@bar");
assertEquals("Invalid request URI", "/uri/query=foo@bar", result);
result = template.getForObject(URI + "/uri/query={query}", String.class, "T\u014dky\u014d");
assertEquals("Invalid request URI", "/uri/query=T%C5%8Dky%C5%8D", result);
}
@Test

View File

@ -135,6 +135,8 @@ public class UriUtilsTest {
UriUtils.encodeHttpUrl("https://www.ietf.org/rfc/rfc3986.txt", ENC));
assertEquals("Invalid encoded HTTP URL", "http://www.google.com/?q=Z%C3%BCrich",
UriUtils.encodeHttpUrl("http://www.google.com/?q=Z\u00fcrich", ENC));
assertEquals("Invalid encoded HTTP URL", "http://ws.geonames.org/searchJSON?q=T%C5%8Dky%C5%8D&style=FULL&maxRows=300",
UriUtils.encodeHttpUrl("http://ws.geonames.org/searchJSON?q=T\u014dky\u014d&style=FULL&maxRows=300", ENC));
assertEquals("Invalid encoded HTTP URL",
"http://arjen:foobar@java.sun.com:80/javase/6/docs/api/java/util/BitSet.html?foo=bar",
UriUtils.encodeHttpUrl(