When emoticons represented in unicode format are used as input to html() method, the output is not always as expected. For example, below is my code -
var smilingEyes = "\ud83d\ude01";
el.html(smilingEyes); // This works and displays the emoji correctly
var unicodeFormatOfSmiley = data.unicodeFormatFromServer; // The value of this is - \ud83d\ude01
el.html(unicodeFormatOfSmiley); // This does not work!!!!!!!!
The problem arises when I get the emoji represented in unicode format from the backend server. I checked, re-checked and again checked the unicode sent from the server. The server is sending the correct unicode representation of the emoji and when I use this in the html() element, instead of displaying the emoji, the unicode representation of the emoji is displayed.
Any help, suggestion is greatly appreciated.