Fix emojis on py3#24
Merged
leandrotoledo merged 1 commit intopython-telegram-bot:masterfrom Aug 8, 2015
franciscod:py3-emoji
Merged
Fix emojis on py3#24leandrotoledo merged 1 commit intopython-telegram-bot:masterfrom franciscod:py3-emoji
leandrotoledo merged 1 commit intopython-telegram-bot:masterfrom
franciscod:py3-emoji
Conversation
Member
|
Nice catch. Thank you! |
Contributor
Author
|
Seeing #80 and #85, I think this was not the right solution: we often want to use emojis as strings, not as bytes... Maybe we should revert this, and instead do something like: from __future__ import unicode_literalsor its alternatives from here http://python-future.org/unicode_literals.html Also, we should really have unit tests on these things for py2 and py3. |
Member
Well now I feel stupid about #85 😁 |
Contributor
Author
|
Haha, it happens frequently; python has really clever solutions for some stuff :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The py2 string literals are interpreted as bytes on py3, so emojis on py3 aren't working.
Using
b'\xF0\x9F\x98\x81'instead of'\xF0\x9F\x98\x81'fixes it: it now works in both py2 and py3 (tested with 2.7.10 and 3.4.3)