Chat Emoji Issue


Over the past few days I’ve been investigating an issue in a chat client I’m working on wherein certain emojis aren’t being parsed correctly (:family_woman_woman_girl_girl:, for example). Instead, what I get is each individual emoji that makes up the whole… so in my chat I see :woman::woman::girl::girl:.

After testing with various websocket libraries, and confirming that the regex I’m using is working as expected to parse this emoji (and others like it), I’ve determined that the issue seems to be on the Twitch side.

I’m guessing this has something to do with Twitch parsing out any form of space in order to prevent blank messages from being sent, however it seems to be stripping out the zero width joiner character ( from emojis as well.

Not sure exactly how to proceed from here, I could write some code to fix this deficiency but if a user happened to enter certain emojis into the chat with no spaces, it may result in a false match and the wrong emoji being displayed anyway (though this would probably be very uncommon). Preferably I’d like to see this fixed on the Twitch side.

Any feedback is appreciated.


is the chat client written in javascript? Your issue seems very similar to one I came across. You might already know from your research that some emojis are just a combination of two unicode characters. If you’re using javascript like I was to parse out the chat message then you should be aware that there are limitations to the javascript language that cause this issue. You will have to write/find a solution to specifically handle special cases where some individual emojis are represented as a surrogate pair of two unicode characters.

Thanks for the feedback, the client is written in c# and I’m fairly positive twitch is just stripping the characters as the code works when I manually feed it a valid emoji.

Edit: this is the code in question if anyone wants to take a peek at it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.