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

冷暖自知 提交于 2019-12-01 05:10:16

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/'         => '👋',
'</3'        => '💔',
'<3'         => '💗',
'8-D'        => '😁',
'8D'         => '😁',
':-D'        => '😁',
'=-3'        => '😁',
'=-D'        => '😁',
'=3'         => '😁',
'=D'         => '😁',
'B^D'        => '😁',
'X-D'        => '😁',
'XD'         => '😁',
'x-D'        => '😁',
'xD'         => '😁',
':\')'       => '😂',
':\'-)'      => '😂',
':-))'       => '😃',
'8)'         => '😄',
':)'         => '😄',
':-)'        => '😄',
':3'         => '😄',
':D'         => '😄',
':]'         => '😄',
':^)'        => '😄',
':c)'        => '😄',
':o)'        => '😄',
':}'         => '😄',
':っ)'        => '😄',
'=)'         => '😄',
'=]'         => '😄',
'0:)'        => '😇',
'0:-)'       => '😇',
'0:-3'       => '😇',
'0:3'        => '😇',
'0;^)'       => '😇',
'O:-)'       => '😇',
'3:)'        => '😈',
'3:-)'       => '😈',
'}:)'        => '😈',
'}:-)'       => '😈',
'*)'         => '😉',
'*-)'        => '😉',
':-,'        => '😉',
';)'         => '😉',
';-)'        => '😉',
';-]'        => '😉',
';D'         => '😉',
';]'         => '😉',
';^)'        => '😉',
':-|'        => '😐',
':|'         => '😐',
':('         => '😒',
':-('        => '😒',
':-<'        => '😒',
':-['        => '😒',
':-c'        => '😒',
':<'         => '😒',
':['         => '😒',
':c'         => '😒',
':{'         => '😒',
':っC'        => '😒',
'%)'         => '😖',
'%-)'        => '😖',
':-P'        => '😜',
':-b'        => '😜',
':-p'        => '😜',
':-Þ'        => '😜',
':-þ'        => '😜',
':P'         => '😜',
':b'         => '😜',
':p'         => '😜',
':Þ'         => '😜',
':þ'         => '😜',
';('         => '😜',
'=p'         => '😜',
'X-P'        => '😜',
'XP'         => '😜',
'd:'         => '😜',
'x-p'        => '😜',
'xp'         => '😜',
':-||'       => '😠',
':@'         => '😠',
':-.'        => '😡',
':-/'        => '😡',
':/'         => '😡',
':L'         => '😡',
':S'         => '😡',
':\\'        => '😡',
'=/'         => '😡',
'=L'         => '😡',
'=\\'        => '😡',
':\'('       => '😢',
':\'-('      => '😢',
'^5'         => '😤',
'^<_<'       => '😤',
'o/\\o'      => '😤',
'|-O'        => '😫',
'|;-)'       => '😫',
':###..'     => '😰',
':-###..'    => '😰',
'D-\':'      => '😱',
'D8'         => '😱',
'D:'         => '😱',
'D:<'        => '😱',
'D;'         => '😱',
'D='         => '😱',
'DX'         => '😱',
'v.v'        => '😱',
'8-0'        => '😲',
':-O'        => '😲',
':-o'        => '😲',
':O'         => '😲',
':o'         => '😲',
'O-O'        => '😲',
'O_O'        => '😲',
'O_o'        => '😲',
'o-o'        => '😲',
'o_O'        => '😲',
'o_o'        => '😲',
':$'         => '😳',
'#-)'        => '😵',
':#'         => '😶',
':&'         => '😶',
':-#'        => '😶',
':-&'        => '😶',
':-X'        => '😶',
':X'         => '😶',
':-J'        => '😼',
':*'         => '😽',
':^*'        => '😽',
'ಠ_ಠ'        => '🙅',
'*\\0/*'     => '🙆',
'\\o/'       => '🙆',
':>'         => '😄',
'>.<'        => '😡',
'>:('        => '😠',
'>:)'        => '😈',
'>:-)'       => '😈',
'>:/'        => '😡',
'>:O'        => '😲',
'>:P'        => '😜',
'>:['        => '😒',
'>:\\'       => '😡',
'>;)'        => '😈',
'>_>^'       => '😤',

I used Name is carl links to generate this list:

{ ,:(: "😓", ,:): "😅", ,:-(: "😓", ,:-): "😅", 0:): "😇", 0:-): "😇", 8-): "😎", :"): "😊", :$: "😒", :'(: "😢", :'): "😂", :'-(: "😢", :'-): "😂", :'-D: "😂", :'D: "😂", :(: "😦", :): "😃", :*: "😗", :,'(: "😭", :,'-(: "😭", :,(: "😢", :,): "😂", :,-(: "😢", :,-): "😂", :,-D: "😂", :,D: "😂", :-"): "😊", :-$: "😒", :-(: "😦", :-): "😃", :-*: "😗", :-/: "😕", :-@: "😡", :-D: "😄", :-o: "😮", :-O: "😮", :-P: "😛", :-S: "😒", :-Z: "😒", :-|: "😐", :/: "😕", :@: "😡", :D: "😄", :o: "😮", :O: "😮", :P: "😛", :s: "😒", :z: "😒", :|: "😐", ;(: "😭", ;): "😉", ;-(: "😭", ;-): "😉", ]:): "😈", ]:-): "😈", B-): "😎", o:): "😇", O:): "😇", O:-): "😇", o:-): "😇", X-): "😆", x-): "😆" }

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:             [ ';)', ';-)' ]
};
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!