Extract a charset from a chunk of data
- Parameters
-
| data | Pointer to buffer containing data |
| len | Buffer length |
| mibenum | Pointer to location containing current MIB enum |
| source | Pointer to location containint current charset source |
- Returns
- PARSERUTILS_OK on success, appropriate error otherwise
mibenum and source will be updated on exit
The larger a chunk of data fed to this routine, the better, as it allows charset autodetection access to a larger dataset for analysis.
Meaning of *source on entry:
CONFIDENT - Do not pass Go, do not attempt auto-detection. TENTATIVE - We've tried to autodetect already, but subsequently discovered that we don't actually support the detected charset. Thus, we've defaulted to Windows-1252. Don't perform auto-detection again, as it would be futile. (This bit diverges from the spec) UNKNOWN - No autodetection performed yet. Get on with it.
- Todo:
- We probably want to wait for ~512 bytes of data / 500ms here
- Todo:
- Charset autodetection