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

File encoding guessing with charade (= chardet) #21

Closed
Diaoul opened this issue Dec 8, 2012 · 3 comments
Closed

File encoding guessing with charade (= chardet) #21

Diaoul opened this issue Dec 8, 2012 · 3 comments

Comments

@Diaoul
Copy link

Diaoul commented Dec 8, 2012

This could be used on a failed attempt to open a file due to UnicodeDecodeError. charade would be called to detect the encoding and a second attempt to open the file would be done.
This would be the default behavior and suppressed if encoding argument is not None.

What do you think?

@byroot
Copy link
Owner

byroot commented Dec 8, 2012

For now I stated that guessing the encoding belongs to the application that use pysrt.

But now that you talk about it, it's silly because we already detect encoding through BOMs in the library and we also depends of chardet because of the srt command.

So I think it's a good idea. If you want to fill a pull request tell me, otherwise I'll do it in a few days.

Le 2012-12-08 à 14:31, Antoine Bertin notifications@github.com a écrit :

This could be used on a failed attempt to open a file due to UnicodeDecodeError. charade would be called to detect the encoding and a second attempt to open the file would be done.
This would be the default behavior and suppressed if encoding argument is not None.

What do you think?


Reply to this email directly or view it on GitHub.

@byroot
Copy link
Owner

byroot commented Dec 14, 2012

I can't figure out why but the python3 version of charade have trouble to detect BOM files.

It return me different variations of ISO encodings for my tests files.
The bug is also present in chardet2

I should fill an issue ...

For now it delay the pysrt3 release.

@byroot byroot reopened this Dec 14, 2012
@byroot
Copy link
Owner

byroot commented Jan 6, 2013

Everything is green now.

@byroot byroot closed this as completed Jan 6, 2013
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

2 participants