public class PrescanMetadataSniffer extends BaseEncodingSniffer
EncodingSniffer that pre-scan byte stream for
<meta http-equiv="content-type" ... > tag.
This is step 6 of WHAT-NG prescription, but decodes pre-scanned
content as UTF-8 to simplify the code. That should okay
for the purpose...
CHANGE: 1.8.1 2014-07-07 override UTF-16 encodings to
UTF-8, and x-user-defined encoding to Windows-1252,
as prescribed by WHAT-NG.
| Modifier and Type | Field and Description |
|---|---|
protected static int |
MAX_CHARSET_READAHEAD |
CHARSET_TOKEN, HTTP_CONTENT_TYPE_HEADER| Constructor and Description |
|---|
PrescanMetadataSniffer() |
| Modifier and Type | Method and Description |
|---|---|
String |
sniff(Resource resource) |
contentTypeToCharset, isCharsetSupported, mapCharsetprotected static final int MAX_CHARSET_READAHEAD
public String sniff(Resource resource)
sniff in interface EncodingSniffersniff in class BaseEncodingSnifferCopyright © 2005–2015 IIPC. All rights reserved.