public static String enc ( String unencodedString ) { try { return URLEncoder . encode ( unencodedString , "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { } // UTF-8 is never unsupported return null ; }
Shortcut to URLEncoder . encode with UTF - 8 .