cChardet is high speed universal character encoding detector.
Maintained. Last release 2 weeks ago, commits in 6 of the last 26 weeks. Weaker on contributor spread and security practices.
pip install cchardetcChardet
cChardet is a high-speed universal character encoding detector built on the PyYoshi/uchardet fork, which tracks upstream uchardet.
Python support
cChardet supports CPython 3.11 through 3.15, including the free-threaded CPython 3.14 and 3.15 builds. Each version is tested on Linux and Windows on both x86-64 and arm64, and on macOS on Apple silicon.
detect() and detect_all() can be called from many threads at once. A
UniversalDetector serializes its methods with a per-instance lock, so sharing
one between threads cannot crash the interpreter, but the calls interleave:
every feed goes into one stream, any thread's reset() or close() affects all
callers, and done and result wait for a feed in progress. Use one detector
per input.
Development
Install uv, clone this repository with its submodules, then create the locked development environment and run the checks:
git submodule update --init --recursive
uv sync --locked
make check
Build and validate the source distribution and wheel with:
uv build
uv run twine check dist/*
Supported Languages/Encodings
- International (Unicode)
- UTF-8
- UTF-16BE / UTF-16LE
- UTF-32BE / UTF-32LE / X-ISO-10646-UCS-4-34121 / X-ISO-10646-UCS-4-21431
- Arabic
- ISO-8859-6
- WINDOWS-1256
- Bulgarian
- ISO-8859-5
- WINDOWS-1251
- Chinese
- ISO-2022-CN