Enhance encoding detection.