public static String encode(final String value, final String encoding) {
    try {
      return (value != null ? URLEncoder.encode(value, encoding) : value);
    } catch (UnsupportedEncodingException ignore) {
      return value;
    }
  }
Encode the String value using the specified encoding.
<p>

@param value the String value to encode.
@param encoding a String value indicating the encoding.
@return an encoded value of the String using the specified encoding. If the encoding is
        unsupported, then value is returned.
@see java.net.URLEncoder
geode-web/src/main/java/org/apache/geode/management/internal/web/util/UriUtils.java