Package com.globalmentor.io
Class Charsets
java.lang.Object
com.globalmentor.io.Charsets
Utilities for working with charsets.
In most cases, rather that using the names provided here, consider using Charset.name()
for one of the predefined charsets in
StandardCharsets
.
- Author:
- Garret Wilson
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The canonical name of the ISO-8859-1 charset.static final String
The canonical name of the US-ASCII charset.static final String
The canonical name of the general 16-bit UTF-16 charset (which requires an initial Byte Order Mark).static final String
The canonical name of the 16-bit UTF-16 big-endian charset.static final String
The canonical name of the 16-bit UTF-16 little-endian charset.static final String
The canonical name of the 32-bit UTF-32 charset.static final String
The canonical name of the 32-bit UTF-32 big-endian charset.static final String
The canonical name of the 32-bit UTF-32 little-endian charset.static final String
The canonical name of the eight-bit UTF-8 charset (to which the big-endian/little-endian byte order does not apply).static final String
The canonical name of the Cp1252 charset. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CharsetDecoder
newDecoder
(Charset charset, CodingErrorAction codingErrorAction) Convenience method for creating a new decoder from a charset and setting its error handling approach for malformed input and unmappable characters.
-
Field Details
-
UTF_8_NAME
The canonical name of the eight-bit UTF-8 charset (to which the big-endian/little-endian byte order does not apply).- See Also:
-
UTF_16_NAME
The canonical name of the general 16-bit UTF-16 charset (which requires an initial Byte Order Mark).- See Also:
-
UTF_16BE_NAME
The canonical name of the 16-bit UTF-16 big-endian charset.- See Also:
-
UTF_16LE_NAME
The canonical name of the 16-bit UTF-16 little-endian charset.- See Also:
-
UTF_32_NAME
The canonical name of the 32-bit UTF-32 charset.- See Also:
-
UTF_32BE_NAME
The canonical name of the 32-bit UTF-32 big-endian charset.- See Also:
-
UTF_32LE_NAME
The canonical name of the 32-bit UTF-32 little-endian charset.- See Also:
-
US_ASCII_NAME
The canonical name of the US-ASCII charset.- See Also:
-
ISO_8859_1_NAME
The canonical name of the ISO-8859-1 charset.- See Also:
-
WINDOWS_1252_NAME
The canonical name of the Cp1252 charset.- See Also:
-
-
Constructor Details
-
Charsets
public Charsets()
-
-
Method Details
-
newDecoder
public static CharsetDecoder newDecoder(@Nonnull Charset charset, @Nonnull CodingErrorAction codingErrorAction) Convenience method for creating a new decoder from a charset and setting its error handling approach for malformed input and unmappable characters.- Parameters:
charset
- The charset from which to create the decoder.codingErrorAction
- The action to take if the data being decoded is invalid.- Returns:
- The new configured decoder.
- See Also:
-