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

Wrong detection UTF-8 with ö symbol #288

Open
sergei-sss opened this issue Mar 29, 2024 · 0 comments
Open

Wrong detection UTF-8 with ö symbol #288

sergei-sss opened this issue Mar 29, 2024 · 0 comments

Comments

@sergei-sss
Copy link

sergei-sss commented Mar 29, 2024

Hi! I'm not an expert in encoding. Can someone please advise me on what I'm doing wrong? The example seems quite simple, but the result is incorrect. Perhaps, it's assumed to use a library for larger texts?

b = b'Sch\xc3\xb6ne gesunde Pflanzen'
chardet.detect(b)  # {'encoding': 'ISO-8859-9', 'confidence': 0.6294978352301421, 'language': 'Turkish'}
b.decode(chardet.detect(b)['encoding'])  # Result: 'Schöne gesunde Pflanzen'
b.decode("utf-8")  # Result: 'Schöne gesunde Pflanzen'

5.2.0/3.11.7

@sergei-sss sergei-sss changed the title Wrong detection UTF-8 Wrong detection UTF-8 with ö symbol Mar 29, 2024
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

1 participant