Print Unicode emoji from API response [duplicate]

狂风中的少年 提交于 2019-12-25 06:32:30

问题


I am receiving the string @"\\U0001F603" from an API, which is the Unicode code point for the emoji 😃.

I want to display it using an UILabel's text property. If I directly set it, it shows \U0001F603 instead of the actual emoji.

How can I display the emoji at the received Unicode code point?


回答1:


You have to remove first slash. like this

label.text=@"\U0001F603";

😃.




回答2:


This usually helps me

[NSString stringWithUTF8String:model.UTF8String];


来源:https://stackoverflow.com/questions/38181966/print-unicode-emoji-from-api-response

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!