public static String encode ( String input ) { try { return URLEncoder . encode ( input , "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { // This never happens. return input ; } }
URL - encode the input with UTF - 8 .