Why does decoding a whole URI keep %2F?
Whole URI decoding keeps escapes for reserved separators such as slash. Use URL component when the escaped slash belongs within a single value you want to read.
Convert text to UTF-8 percent escapes or read encoded text. Choose a mode based on where the value belongs in the URL.
Use URL component for one path segment or a search value before adding it to a URL. If that value contains an ampersand or slash, it is percent-encoded so it can be read as part of the value. Whole URI uses JavaScript URI rules and keeps common separators such as slashes, question marks, and equals signs.
Choose HTML form value when spaces are written as plus signs. It decodes a plus sign to a space and a percent-encoded plus sign to a literal plus sign. The other modes preserve literal plus signs when decoding.
Whole URI decoding keeps escapes for reserved separators such as slash. Use URL component when the escaped slash belongs within a single value you want to read.
The decoder reports an incomplete escape or invalid UTF-8 sequence. Check that every percent escape has two hexadecimal digits and that escapes for a multibyte character are all present.
Encoding treats an existing percent sign as input text and encodes it again. Start with the unencoded value when you want one layer of escaping.