Package fr.becpg.repo.helper
Class UrlPathEncoder
java.lang.Object
fr.becpg.repo.helper.UrlPathEncoder
Encodes a value, typically a file name, as a URL path segment or an RFC 5987 header parameter.
Unlike
org.springframework.extensions.surf.util.URLEncoder, which encodes each UTF-16 char on its
own and therefore breaks characters outside the BMP (emojis) into two invalid sequences, this encoder
works on code points and always produces valid UTF-8 percent-encoding.- Author:
- valentin
-
Field Details
-
FORM_ENCODED_SPACE
- See Also:
-
PERCENT_ENCODED_SPACE
- See Also:
-
-
Constructor Details
-
UrlPathEncoder
private UrlPathEncoder()
-
-
Method Details
-
encode
Percent-encodes a value in UTF-8, spaces included as%20.- Parameters:
value- the value to encode- Returns:
- the encoded value
-