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 non-ASCII chars correctly #22

Merged
merged 11 commits into from
Jan 24, 2016
Merged

Conversation

Boudewijn26
Copy link
Contributor

According to #21 tokens aren't correctly calculated when they contain non-ASCII chars. I found and fixed the bug, as well as adding a couple extra tests.

@Boudewijn26
Copy link
Contributor Author

Any suggestions as to properly handle both Python 2.7 and 3.x unicode string handling without too much ado? (Besides dropping support for Python 3.2?)

 As it turns out a lot of the token-script was just doing the utf-8 encoding of a piece of text. Python can also do that, so now it's way simpler.
@desbma
Copy link
Contributor

desbma commented Jan 18, 2016

b"h\xc3\xa9".decode("utf-8") would return text for Python 2.7, 3.2 and 3.4.

Otherwise there is six.text_type, but that would introduce a new dependency.

@pndurette
Copy link
Owner

From what I read, dropping Python 3.2 is the thing to do and what most projects are doing. So I guess we can agree on this. Thanks a lot for this (fast) fix @Boudewijn26! Will release this shortly.

pndurette added a commit that referenced this pull request Jan 24, 2016
Handle non-ASCII chars correctly
@pndurette pndurette merged commit 81e60ca into pndurette:develop Jan 24, 2016
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.

3 participants