cChardet is high speed universal character encoding detector. - binding to uchardet.
import cchardet as chardet
with open(r"tests/samples/wikipediaJa_One_Thousand_and_One_Nights_SJIS.txt", "rb") as f:
msg = f.read()
result = chardet.detect(msg)
print(result)
$ python setup.py build_ext -i -f
$ python tests/bench.py
CPU: AMD Ryzen 9 7950X3D
RAM: DDR5-5600MT/s 96GB
Platform: Ubuntu 24.04 amd64
Request (call/s) | |
---|---|
chardet v5.2.0 | 1.1 |
cchardet v2.2.0a1 | 2263.6 |
See COPYING file.