Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Incorrect Encoding Detection as Big5 #33

Open
dxdc opened this issue Aug 27, 2024 · 3 comments
Open

BUG: Incorrect Encoding Detection as Big5 #33

dxdc opened this issue Aug 27, 2024 · 3 comments

Comments

@dxdc
Copy link

dxdc commented Aug 27, 2024

OS/Arch

macOS

Python version

python 3.11

cChardet version

2.1.18

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

@wbarnha
Copy link
Member

wbarnha commented Aug 27, 2024

Thanks for providing a reference file! I see that the main project has been updated recently, so I'm going to pull in changes and see if there's any luck with the original maintainer's fixes.

@dxdc
Copy link
Author

dxdc commented Aug 27, 2024

Thanks for the checking this out so quickly! It was difficult to create that reference file, but hopefully it gives some insights as to where the problem came from.

@dxdc
Copy link
Author

dxdc commented Sep 16, 2024

hi @wbarnha ... did you have any luck with this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@dxdc @wbarnha and others