public static String encodeParam(String param){
  try {
    return URLEncoder.encode(param,"UTF-8");
  }
 catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
    return "";
  }
}

public static String encodeParam ( String param ) { try { return URLEncoder . encode ( param , "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { e . printStackTrace ( ) ; return "" ; } }
returns the given param url - encoded .
