public final class StandardEncodingTranslator extends Object implements EncodingTranslator
| Modifier and Type | Field and Description |
|---|---|
static Map<String,String> |
ENCODING_FROM_LABEL
Encoding names and labels
Made public to let other also use this (like HtmlUnit TextDecoder).
|
static Map<String,String> |
ENCODING_TO_IANA_ENCODING
Differences from iana naming
Made public to let other also use this (like HtmlUnit TextDecoder).
|
static Map<String,String> |
IANA_TO_JAVA_ENCODINGS |
static StandardEncodingTranslator |
INSTANCE
Singleton.
|
static String |
REPLACEMENT
https://encoding.spec.whatwg.org/#replacement
For the moment we are using this constant in the
HTMLScanner to support
this encoding. |
public static final StandardEncodingTranslator INSTANCE
public static final String REPLACEMENT
For the moment we are using this constant in the HTMLScanner to 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.
public static final Map<String,String> ENCODING_FROM_LABEL
public static final Map<String,String> ENCODING_TO_IANA_ENCODING
public String encodingNameFromLabel(String charsetLabel)
encodingNameFromLabel in interface EncodingTranslatornull if the name
is unknown. The returned encoding name may or may not be supported by the running JVM. Use
Charset.isSupported(String) to check availability. Moreover, either of the special definitions
REPLACEMENT or "x-user-defined" may be returned depending on input.Copyright © 2024 HtmlUnit. All rights reserved.