Add callbacks to Detector
Handle Encoding::CompatibilityError
API example