[][src]Function chardetng_c::chardetng_encoding_detector_new

#[no_mangle]
pub unsafe extern "C" fn chardetng_encoding_detector_new(
) -> *mut EncodingDetector

Instantiates a Web browser-oriented detector for guessing what character encoding a stream of bytes is encoded in.

The bytes are fed to the detector incrementally using the chardetng_encoding_detector_free function. The current guess of the detector can be queried using the chardetng_encoding_detector_guess function. The guessing parameters are arguments to the chardetng_encoding_detector_guess function rather than arguments to the constructor in order to enable the application to check if the arguments affect the guessing outcome. (The specific use case is to disable UI for re-running the detector with UTF-8 allowed and the top-level domain name ignored if those arguments don't change the guess.)

The instantiated detector must be freed after use using chardetng_detectordetector_free.