简体   繁体   English

如何支持HTML以显示来自Mobile的DB设置的Emoji表情

[英]How to support HTML to show emoji getting from DB setting from Mobile using angular

Scenario: We have a mobile app in which the User's name is editable. 场景:我们有一个移动应用程序,其中用户名是可编辑的。 And developing a Angular web application to show user data. 并开发一个Angular Web应用程序以显示用户数据。

The problem occurs when user adds emoji in their name using app but in website we are getting them as \\\?\\\?\\\?\\\?\\\?\\\\ude2\u003c/code> , binding data in ng-bind. 当用户使用应用程序以他们的名字添加表情符号,但是在网站上我们将它们作为\\\?\\\?\\\?\\\?\\\?\\\\ude2\u003c/code>绑定到ng-bind中的数据时,就会出现问题。

Already added meta-tag <meta charset="UTF-8"> . 已经添加了元标记<meta charset="UTF-8">

Need help to resolve this issue. 需要帮助来解决此问题。

HTML Code HTML代码

<span class="user-name" ng-bind="feed.profileDisplayName"></span>

Thank you. 谢谢。

One can use eval to convert it: 可以使用eval进行转换:

 var x="\\\?\\\?\\\?\\\?"; console.log(x); eval("y=\\""+x+"\\""); console.log("y=",y); 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM