public String escapeString ( String str ) { try { return URLEncoder . encode ( str , "utf8" ) . replaceAll ( "\\+" , "%20" ) ; } catch ( UnsupportedEncodingException e ) { return str ; } }
Escape the given string to be used as URL query value .