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

Name is carl picture Name is carl · Apr 7, 2015 · Viewed 7.1k times · Source

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?

Answer

tchrist picture tchrist · Apr 11, 2015

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'        => '😜',
'>:['        => '😒',
'>:\\'       => '😡',
'>;)'        => '😈',
'>_>^'       => '😤',