Handling Emojis in JS

Satya
1 min readMay 24, 2018

--

Now a days emojis are the most popular things in chat. When we are handling the emojis some times in database the emojis will be stored as “?”(question marks). Most probably it will happen with Google DataStore. When we are sending some emojis in chat from browser it will be like unicodes like (\u) characters.

For, handling this emojis we need to convert the emojis into unicodes and need to be stored in the database. The below function will handle the conversation. It will take the Raw Emojis and it will convert to “\u” Characters.

let’s check with the samples.

After running this We will get the “\u” characters.

Thanks 😀😀😀😀😀😀

--

--