2014-11-04 86 views
-5

我有以下字符串:如何在HTML上渲染Emoji?

\ud83d\udc51 CODE :: davon top\n\ud83d\udc51 MATERIAL :: spandek rayon\n\ud83d\udc51 PRICE :: 70.000\n\nFIX ORDER langsung hubungi contact :\n\ud83d\udc49 LINE : hijabroom\n\ud83d\udc49 PIN BB : 28EFA80B\nRead mekanisme before order!\n\n 

,我想使它像下面這樣:

Desired Emoji HTML Rendering of String Above

我怎麼可以這樣做?

+2

這可能有所幫助:http://timwhitlock.info/blog/2013/03/emoji-on-the-web/ – Philibobby 2014-11-04 03:20:08

+1

請見[this](http://apps.timwhitlock.info/emoji/tables/unicode)和[this](http://www.busydoingnothing.co.uk/emoji.html) – 2014-11-04 03:55:09

回答

0

正如我所看到的,您應該創建關鍵字與您的所有Emojis(如Unicode序列)相等的數組,並且相應的值等於鏈接到表示明確表情符號的圖像。那麼你只需要用圖像替換Emoji代碼(例如使用正則表達式)