Package com.helger.base.codec.impl
Class RFC5987Codec
java.lang.Object
com.helger.base.codec.impl.RFC5987Codec
RFC 5987 Encoder. Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP)
Header Field Parameters
- Author:
- Philip Helger
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor using UTF-8 charset.RFC5987Codec(@NonNull Charset aCharset) Constructor using a specific charset. -
Method Summary
Modifier and TypeMethodDescription@Nullable StringgetEncoded(@Nullable String sSrc) Encode the passed string using RFC 5987 encoding with the charset specified in the constructor.static @NonNull StringgetRFC5987Encoded(@NonNull String sSrc, @NonNull Charset aCharset) Encode the passed string using RFC 5987 encoding with the specified charset.static @NonNull StringgetRFC5987EncodedUTF8(@NonNull String sSrc) Encode the passed string using RFC 5987 encoding with UTF-8 charset.
-
Field Details
-
ESCAPE_CHAR
public static final char ESCAPE_CHAR- See Also:
-
-
Constructor Details
-
RFC5987Codec
public RFC5987Codec()Default constructor using UTF-8 charset. -
RFC5987Codec
Constructor using a specific charset.- Parameters:
aCharset- The charset to use for encoding. May not benull.
-
-
Method Details
-
getRFC5987Encoded
Encode the passed string using RFC 5987 encoding with the specified charset.- Parameters:
sSrc- The source string to encode. May not benull.aCharset- The charset to use for encoding. May not benull.- Returns:
- The encoded string. Never
null.
-
getRFC5987EncodedUTF8
Encode the passed string using RFC 5987 encoding with UTF-8 charset.- Parameters:
sSrc- The source string to encode. May not benull.- Returns:
- The encoded string. Never
null.
-
getEncoded
Encode the passed string using RFC 5987 encoding with the charset specified in the constructor.- Specified by:
getEncodedin interfaceIEncoder<String,String> - Parameters:
sSrc- The source string to encode. May benull.- Returns:
- The encoded string or
nullif the input wasnull.
-