code: public static String urlEncode(String string) {
      if (string == null) {
        return null;
      }
      try {
        return encode(string, StandardCharsets.UTF_8.name());
      } catch (UnsupportedEncodingException e) {
        throw new IllegalStateException("Platform doesn't support " + StandardCharsets.UTF_8.name(), e);
      }
    }
docs: URL-encodes a string.
  <p>
  Assumes {@code string} is in {@link StandardCharsets#UTF_8} format.
  
  @param string
  The string to URL-encode.
  @return The URL-encoded version of the input string, or {@code null} if {@code string} is {@code null}.
  @throws IllegalStateException
  If unable to URL-encode because the JVM doesn't support {@link StandardCharsets#UTF_8}.