/** * Decodes a bit of an URL encoded by a browser. * <p> * This is equivalent to calling {@link #decodeComponent(String, Charset)} * with the UTF-8 charset (recommended to comply with RFC 3986, Section 2). * @param s The string to decode (can be empty). * @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. */ public static String decodeComponent(final String s) { return decodeComponent(s, HttpConstants.DEFAULT_CHARSET); }
if (c == '=' && name == null) { if (pos != i) { name = decodeComponent(s.substring(pos, i), charset); if (!addParam(params, decodeComponent(s.substring(pos, i), charset), "")) { return; if (!addParam(params, name, decodeComponent(s.substring(pos, i), charset))) { return; addParam(params, decodeComponent(s.substring(pos, i), charset), ""); } else { // Yes and this must be the last value. addParam(params, name, decodeComponent(s.substring(pos, i), charset));