Code example for UnsupportedEncodingException

Methods: printStackTrace

0
  public static String encodeParam(String param) {
    try { 
      return URLEncoder.encode(param, "UTF-8");
    } catch (UnsupportedEncodingException e) {
      // UTF-8 should be available, so just in case 
      e.printStackTrace();
      return ""; 
    } 
  } 
}