Class URIDecoder

    • Method Detail

      • decodeURIComponent

        public static String decodeURIComponent​(String s)
        Decodes a segment of an URI encoded by a browser. The string is expected to be encoded as per RFC 3986, Section 2. This is the encoding used by JavaScript functions encodeURI and encodeURIComponent, but not escape. For example in this encoding, é (in Unicode U+00E9 or in UTF-8 0xC3 0xA9) is encoded as %C3%A9 or %c3%a9. Plus signs '+' will be handled as spaces and encoded using the default JDK URLEncoder class.
        Parameters:
        s - string to decode
        Returns:
        decoded string
      • decodeURIComponent

        public static String decodeURIComponent​(String s,
                                                boolean plus)
        Decodes a segment of an URI encoded by a browser. The string is expected to be encoded as per RFC 3986, Section 2. This is the encoding used by JavaScript functions encodeURI and encodeURIComponent, but not escape. For example in this encoding, é (in Unicode U+00E9 or in UTF-8 0xC3 0xA9) is encoded as %C3%A9 or %c3%a9.
        Parameters:
        s - string to decode
        plus - weather or not to transform plus signs into spaces
        Returns:
        decoded string