code: private static String decodeComponent(final String s, final Charset charset) {
          if (s == null) {
              return EMPTY_STRING;
          }
          return decodeComponent(s, 0, s.length(), charset, false);
      }
docs: Decodes a bit of an URL encoded by a browser.
  <p>
  The string is expected to be encoded as per RFC 3986, Section 2.
  This is the encoding used by JavaScript functions {@code encodeURI}
  and {@code encodeURIComponent}, but not {@code escape}.  For example
  in this encoding, &eacute; (in Unicode {@code U+00E9} or in UTF-8
  {@code 0xC3 0xA9}) is encoded as {@code %C3%A9} or {@code %c3%a9}.
  <p>
  This is essentially equivalent to calling
  {@link java.net.URLDecoder#decode(String, String)}
  except that it's over 2x faster and generates less garbage for the GC.
  Actually this function doesn't allocate any memory if there's nothing
  to decode, the argument itself is returned.
  @param s The string to decode (can be empty).
  @param charset The charset to use to decode the string (should really
  be {@link StandardCharsets#UTF_8}.
  @return The decoded string, or {@code s} if there's nothing to decode.
  If the string to decode is {@code null}, returns an empty string.
  @throws IllegalArgumentException if the string contains a malformed
  escape sequence.