public static Map<String, Object> encode(final Map<String, Object> form, final String encoding) {
    if (form != null) {
      for (final String key : form.keySet()) {
        final Object value = form.get(key);
        if (value instanceof String) {
          form.put(key, encode(value.toString(), encoding));
        }
      }
    }

    return form;
  }
Encodes the String values in the Map using the specified encoding (e.g. UTF-8). The Map is
structurally similar to a key/value data store but with the contents from an HTML form. Keys
with String values are searched and encoded, which then get repaired with the same Key.
<p>

@param form a mapping of key/value pairs containing String values to encode.
@return the original Map (form) with keys re-paired with encoded String values.
@see #encode(String, String)
@see java.net.URLEncoder
geode-web/src/main/java/org/apache/geode/management/internal/web/util/UriUtils.java