code: @SuppressWarnings("deprecation")
      public static String urlEscape(String s) {
          try {
              return URLEncoder.encode(s,"UTF8");
          } catch (UnsupportedEncodingException e) {
              // should be impossible; all JVMs must support UTF8
              // but have a fallback just in case
              return URLEncoder.encode(s); 
          }
      }
docs: Exception- and warning-free URL-escaping utility method.
  
  @param s String to escape
  @return URL-escaped string