cChardet icon indicating copy to clipboard operation
cChardet copied to clipboard

BUG: Incorrect Encoding Detection as Big5

Open dxdc opened this issue 1 year ago • 1 comments

OS/Arch

macOS

Python version

python 3.11

cChardet version

2.1.7

What is the problem?

cChardet is incorrectly detecting the encoding of this file as Big5. I'm not sure if the issue should be posted here or elsewhere.

import cchardet as chardet

with open('abc_1.csv', 'rb') as f:
    result = chardet.detect(f.read())
print(result)
# result:
{'encoding': 'BIG5', 'confidence': 0.9900000095367432}

Expected behavior

  • The correct encoding should be one of the Windows encodings (Windows-1250, 1251, or 1252).

Actual behavior

  • It is detecting the encoding of this file as Big5.

Steps to reproduce the behavior

  • Use cChardet to detect the encoding of the provided CSV file.
  • The encoding is incorrectly detected as Big5.

** Attached file

dxdc avatar Aug 27 '24 16:08 dxdc