Class StandardEncodingTranslator
java.lang.Object
org.htmlunit.cyberneko.xerces.util.StandardEncodingTranslator
- All Implemented Interfaces:
EncodingTranslator
EncodingTranslator based on
https://encoding.spec.whatwg.org/#names-and-labels
-
Field Summary
FieldsModifier and TypeFieldDescriptionEncoding names and labels Made public to let other also use this (like HtmlUnit TextDecoder).Differences from iana naming Made public to let other also use this (like HtmlUnit TextDecoder).static final StandardEncodingTranslatorSingleton.static final Stringhttps://encoding.spec.whatwg.org/#replacement For the moment we are using this constant in theHTMLScannerto support this encoding. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
INSTANCE
Singleton. -
REPLACEMENT
https://encoding.spec.whatwg.org/#replacement For the moment we are using this constant in theHTMLScannerto support this encoding. Another option might be to install a proper charset impl in the jvm (like https://github.com/lovasoa/replacement-charset-java) but this might introduce some behavior changes for the whole vm and therefore we handle it here.- See Also:
-
ENCODING_FROM_LABEL
Encoding names and labels Made public to let other also use this (like HtmlUnit TextDecoder). -
ENCODING_TO_IANA_ENCODING
Differences from iana naming Made public to let other also use this (like HtmlUnit TextDecoder). -
IANA_TO_JAVA_ENCODINGS
-
-
Constructor Details
-
StandardEncodingTranslator
private StandardEncodingTranslator()
-
-
Method Details
-
encodingNameFromLabel
- Specified by:
encodingNameFromLabelin interfaceEncodingTranslator- Returns:
- the Java encoding name for the specified HTTP encoding name, or
nullif the name is unknown. The returned encoding name may or may not be supported by the running JVM. UseCharset.isSupported(String)to check availability. Moreover, either of the special definitionsREPLACEMENTormay be returned depending on input.invalid reference
#USER_DEFINED
-