-
Notifications
You must be signed in to change notification settings - Fork 276
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
Work backwards: \U0001f382 to 🎂 #34
Comments
@The-Penultimate-Defenestrator Yep, it already does that: >>> import emoji
>>> print(emoji.emojize(u"Happy \U0001F382"))
Happy 🎂 Is that not what you had in mind? |
Yes, I wasn't aware it works both ways, and it wasn't in the README. Thanks. |
@The-Penultimate-Defenestrator Now that I look at this again, I led you somewhat astray. This works, but the For instance: print(u"\U0001F382")
🎂 $ echo "\U0001F382"
🎂 |
Right. I already have a Unicode string. I need to convert the Unicode string to the emoji code because I am using it with the Discord APi |
@The-Penultimate-Defenestrator Ah I get it - I was confused by the actual icon in the ticket header. If you wrap the text in backticks, like Yes, this is supported: import emoji
print(emoji.demojize(u"Happy \U0001F382!"))
Happy :birthday_cake:! One note is that the |
Thanks. Demojize is what I was looking for. |
Is it possible for this library to work backwards? Example:
u"\U0001F382"
would change to 🎂The text was updated successfully, but these errors were encountered: