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

Use more sophisticated encoding detection when utf8 decoding fails. #172

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

mikkeldenker
Copy link
Member

Closes #137.

Some websites, especially older ones, sometimes use a different encoding scheme than utf8 or latin1. Before, we simply tried different encoding schemes until one successfully decoded the bytes but this approach can fail unexpectedly as some encodings can erroneously get decoded by other encodings without errors being reported. We now use the encoding detection crate 'chardetng' which also seems to be the one used in firefox.

some websites, especially older ones, sometimes use a different encoding scheme than utf8 or latin1. before, we simply tried different encoding schemes until one successfully decoded the bytes but this approach can fail unexpectedly as some encodings can erronesly get decoded by other encodings without errors being reported.
we now use the encoding detection crate 'chardetng' which is also [used in firefox](https://github.com/hsivonen/chardetng?tab=readme-ov-file#purpose).
@mikkeldenker mikkeldenker merged commit f8c58b3 into main Mar 5, 2024
3 checks passed
@mikkeldenker mikkeldenker deleted the detect-character-encodings branch March 5, 2024 09:55
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

Successfully merging this pull request may close these issues.

Display issue with non-Unicode encoded results
1 participant