Java and RFC 3986 URI encoding
If it's a url, use URI
URI uri = new URI("http", "//hello world", null);
String urlString = uri.toASCIIString();
System.out.println(urlString);
Solved with this:
http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/web/util/UriUtils.html
Method encodeUri