private static final String urlEncode ( String s ) { try { return URLEncoder . encode ( s , "UTF-8" ) ; } catch ( Exception e ) { logger . warn ( "Failed to encode '" + s + "'" , e ) ; return s ; } }
URL - encode the given string using UTF - 8 encoding .