angular 2 not parsing unicode data (\ud83d\ude31 or \u0C28\u0C3E) from http response to view -
i trying parse unicode data http response emoji etc , response coming property - value pair of object in form of message content json data ("messagecontent":"hello \\ud83d\\ude31"
). object form displaying:
data:{... messagecontent:"hello \ud83d\ude31" }
then after assigning messagecontent data template displaying same unicode (hello \ud83d\ude31
), did not change corresponding emoji or character if using chrome's dev tool console like:
var msg = "hello \ud83d\ude31";
then msg value "hello <some emoji or character>"
, if using "textcontent" using javascript element, working fine in case of angular2 assigning data template not working, please suggest something.
the twemoji library convert unicode emoji gifs: canned example:
twemoji.parse( 'i \u2764\ufe0f emoji!', function(icon, options, variant) { return '/assets/' + options.size + '/' + icon + '.gif'; } ); // produce /* <img class="emoji" draggable="false" alt="❤️" src="/assets/36x36/2764.gif"/> emoji! */
by default, options.size parameter string "36x36"
Comments
Post a Comment