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

Handle LookupError when detecting encoding #17

Merged
merged 1 commit into from Aug 19, 2015
Merged

Handle LookupError when detecting encoding #17

merged 1 commit into from Aug 19, 2015

Conversation

DRMacIver
Copy link
Contributor

For reasons that are a slight mystery to me, chardet can return
encodings that Python doesn't actually support.

On the assumption that if we can't decode it we're probably not
interested in considering it as text (especially given that chardet
will sometimes detect an encoding that you can't actually decode as
when its confidence is < 1), this handles this commit by
considering it to not be decodable.

For reasons that are a slight mystery to me, chardet can return
encodings that Python doesn't actually support.

On the assumption that if we can't decode it we're probably not
interested in considering it as text (especially given that chardet
will sometimes detect an encoding that you can't actually decode as
when its confidence is < 1), this handles this commit by
considering it to not be decodable.
audreyfeldroy added a commit that referenced this pull request Aug 19, 2015
Handle LookupError when detecting encoding
@audreyfeldroy audreyfeldroy merged commit e42ae33 into binaryornot:master Aug 19, 2015
@audreyfeldroy
Copy link
Collaborator

@DRMacIver thanks for catching this, much appreciated.

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.

None yet

2 participants