code: public static String escape(String source, String encoding) {
  
          // the blank is encoded into "+" not "%20" when using standard encode call
          return CmsStringUtil.substitute(encode(source, encoding), "+", "%20");
      }
docs: Encodes a String in a way similar to the JavaScript "encodeURIcomponent" function.<p>
  
  JavaScript "decodeURIcomponent" can decode Strings that have been encoded using this method,
  provided "UTF-8" has been used as encoding.<p>
  
  <b>Directly exposed for JSP EL<b>, not through {@link org.opencms.jsp.util.CmsJspElFunctions}.<p>
  
  @param source The text to be encoded
  @param encoding the encoding type
  
  @return The encoded string