Polishing

This commit is contained in:
Sam Brannen
2025-04-03 11:00:00 +02:00
parent d10d8e98c2
commit a9cab2a3f1
6 changed files with 49 additions and 33 deletions

View File

@@ -800,15 +800,19 @@ public abstract class StringUtils {
}
/**
* Decode the given encoded URI component value by replacing "<i>{@code %xy}</i>" sequences
* by an hexadecimal representation of the character in the specified charset, letting other
* characters unchanged.
* @param source the encoded {@code String}
* @param charset the character encoding to use to decode the "<i>{@code %xy}</i>" sequences
* Decode the given encoded URI component value by replacing each
* "<i>{@code %xy}</i>" sequence with a hexadecimal representation of the
* character in the specified character encoding, leaving other characters
* unmodified.
* @param source the encoded URI component value
* @param charset the character encoding to use to decode the "<i>{@code %xy}</i>"
* sequences
* @return the decoded value
* @throws IllegalArgumentException when the given source contains invalid encoded sequences
* @throws IllegalArgumentException if the given source contains invalid encoded
* sequences
* @since 5.0
* @see java.net.URLDecoder#decode(String, String) java.net.URLDecoder#decode for HTML form decoding
* @see java.net.URLDecoder#decode(String, String) java.net.URLDecoder#decode
* for HTML form decoding
*/
public static String uriDecode(String source, Charset charset) {
int length = source.length();