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

Unicode: encoding detection is inaccurate #53

Open
cfrings opened this issue Mar 6, 2018 · 0 comments
Open

Unicode: encoding detection is inaccurate #53

cfrings opened this issue Mar 6, 2018 · 0 comments

Comments

@cfrings
Copy link

cfrings commented Mar 6, 2018

The solution proposed for issue #25 does not, in fact, accurately detect file format when BOM is absent.

If the 32 first characters are pure ASCII, then 'ascii' encoding is "detected". When other characters are present, an encoding compatible with that character is chosen, but it needs not be the correct one.

For instance, with character é present in the first line, I get encoding 'cp-1252' on Windows, while other characters are present later in the file that can't be represented in that encoding (box drawing characters).

The classical coding specification -*- coding: utf-8 -*- is not considered at all.

@cfrings cfrings changed the title Unicode: encoding detection doesn't work Unicode: encoding detection is inaccurate Mar 6, 2018
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