Description
Detect the likely text encoding of bytes before a Python program decodes them. It helps tools read files, web pages, messages, or imported data when the source did not clearly say whether it uses UTF-8, Latin-1, or another encoding.
This is a helper library and detection is probabilistic, not guaranteed. Applications should show errors or allow correction when the guessed encoding would affect user text, records, or data migration.