Is there an equivalence table to convert ASCII smileys to Unicode emoji(s)?

前端 未结 4 953
难免孤独
难免孤独 2021-01-12 09:04

I would like to find a table to convert the old school western ascii emoticons :-) into their modern unicode equivalent ☺.

Do you know if there is one?

相关标签:
4条回答
  • 2021-01-12 09:37

    Found in the code of markdown-it (license MIT)

    module.exports = {
      mad:              [ '>:(', '>:-(' ], // angry
      blush:            [ ':")', ':-")' ],
      broken_heart:     [ '</3', '<\\3' ],
      // :/ & :\ disabled due conflicts, untill logic improved
      confused:         [ /*':\\',*/ ':-\\', /*':/',*/ ':-/' ], // twemoji shows question
      cry:              [ ":'(", ":'-(", ':,(', ':,-(' ],
      frowning:         [ ':(', ':-(' ],
      heart:            [ '<3' ],
      imp:              [ ']:(', ']:-(' ],
      innocent:         [ 'o:)', 'O:)', 'o:-)', 'O:-)', '0:)', '0:-)' ],
      joy:              [ ":')", ":'-)", ':,)', ':,-)', ":'D", ":'-D", ':,D', ':,-D' ],
      kissing:          [ ':*', ':-*' ],
      laughing:         [ 'x-)', 'X-)' ],
      neutral_face:     [ ':|', ':-|' ],
      open_mouth:       [ ':o', ':-o', ':O', ':-O' ],
      rage:             [ ':@', ':-@' ],
      smile:            [ ':D', ':-D' ],
      smiley:           [ ':)', ':-)' ],
      smiling_imp:      [ ']:)', ']:-)' ],
      sob:              [ ":,'(", ":,'-(", ';(', ';-(' ],
      stuck_out_tongue: [ ':P', ':-P' ],
      sunglasses:       [ '8-)', 'B-)' ],
      sweat:            [ ',:(', ',:-(' ],
      sweat_smile:      [ ',:)', ',:-)' ],
      unamused:         [ ':s', ':-S', ':z', ':-Z', ':$', ':-$' ],
      wink:             [ ';)', ';-)' ]
    };
    
    0 讨论(0)
  • 2021-01-12 09:37

    Have a look at emoticon Info on ASCII emoticons. :p https://github.com/wooorm/emoticon/blob/master/index.json

    0 讨论(0)
  • 2021-01-12 09:43

    Not everyone agrees on what is what, but here is one such possible table mapping input ASCII-art emoticons to Unicode emoji. Both data elements are single quoted, so backslashes and single quotes are escaped.

    'o/'         => '                                                                    
    0 讨论(0)
  • 2021-01-12 09:55

    I used Name is carl links to generate this list:

    { ,:(: "

    0 讨论(0)
提交回复
热议问题