Home  >  Q&A  >  body text

javascript - How to convert emoji's unicode into an image

I am making a chat application, and now I have imported emoticons, but I have encountered a new problem, that is, I can only receive emoji Unicode codes when I send them. For example, if I receive a smiley face: smile:, then how do I convert it to Such. Is there anyone who has done such a project? Can you share your experience? Thank you in advance.

PHP中文网PHP中文网2713 days ago933

reply all(3)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-05-16 13:29:01

    EmojiOne

    SupportJS PHP Android iOS Javaetc

    JS

    https://github.com/Ranks/emojione/blob/master/lib/js

    You also need to download the corresponding images or fonts https://www.emojione.com/deve...
    放的位置Refer to the official examples

    How to use

    emojione.shortnameToImage(":see_no_evil:  or :'-) or emoji charset");

    Supported formats

    • :emoji:, for example :see_no_evil: is that

    • pictograms, such as ':-)

    • unicode characters

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-16 13:29:01

    After js obtains the unicode character, it will perform regular filtering on it, convert it into the characters corresponding to the image name, and then assemble the image path so that it can be displayed

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-16 13:29:01

    weChatEmoji

    rrrree

    https://github.com/hu-qi/weCh...

    reply
    0
  • Cancelreply