public final class EncodingDetector extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
EncodingDetector.FallbackEncodingDetector |
| Modifier and Type | Method and Description |
|---|---|
static Charset |
detectEncoding(byte[] input,
boolean assume88591IfNotUtf8,
EncodingDetector.FallbackEncodingDetector alternateDecoder)
Returns the detected encoding of the given byte array.
|
public static Charset detectEncoding(byte[] input, boolean assume88591IfNotUtf8, EncodingDetector.FallbackEncodingDetector alternateDecoder)
input - The data to detect the encoding for.assume88591IfNotUtf8 - True to assume that the encoding is ISO-8859-1 (the standard
encoding for HTTP) if the bytes are not valid UTF-8. Only recommended if you can reasonably
expect that other encodings are going to be specified. Full encoding detection is very
expensive!alternateDecoder - specify a fallback encoding detection.
Only used if assume88591IfNotUtf8 is false.Copyright © 2007-2012. All Rights Reserved.