public static String urlquote ( String text ) { try { return URLEncoder . encode ( text , "UTF-8" ) . replace ( "+" , "%20" ) ; } catch ( UnsupportedEncodingException ex ) { throw new RuntimeException ( ex ) ; } }
Encodes text for inclusion in a URL query string . Should be equivalent to Django s urlquote function .