ga2arch / slack

c++ slack ncurses client
GNU General Public License v3.0
40 stars 3 forks source link

Emoji appear as their text codes #9

Open ctrlcctrlv opened 6 years ago

ctrlcctrlv commented 6 years ago

:slightly_smiling_face: instead of 🙂

My terminal emulator supports Emoji and it works well in e.g. vim.

ctrlcctrlv commented 6 years ago

I'm going to take a crack at implementing this myself via amending SlackClient::format_message

FedeDP commented 6 years ago

We need something like: https://github.com/danielthepope/imojify for c++; after a rapid search i could not find anything though.

EDIT: here is slack doc about emoji: https://api.slack.com/docs/message-formatting#emoji

EDIT2: we can also obviously go the easy way, putting all these codes in a map and use this map to convert any substring in SlackClient::format_message.

ctrlcctrlv commented 6 years ago

The map is pretty much the only thing that's going to work in C++, the reason the imojify library doesn't include a map is because it depends on twemoji which does contain a map.

Since we rely on json already, I right now just generate a header file using https://raw.githubusercontent.com/iamcal/emoji-data/master/emoji_pretty.json

FedeDP commented 5 years ago

A solution here: https://github.com/shalithasuranga/emojicpp. I think that should work well enough. Leaving it here just for future reference :)