Advertisement
westor

$hex2emoji() & $emoji2hex() v1.0 for Koragg

Jul 28th, 2020
3,257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 0.46 KB | None | 0 0
  1. ; $hex2emoji(2764)
  2. ; $emoji2hex(❤️)
  3.  
  4. alias hex2emoji {
  5.   var %u = $base($1,16,10)
  6.  
  7.   if (%u isnum 0-65535) { return $chr($v1) }
  8.  
  9.   return $+($chr($calc((%u -65536)//1024 +55296)),$chr($calc((%u -65536)% 1024 +56320)))
  10. }
  11.  
  12. alias emoji2hex {
  13.   var %asc = $asc($1)
  14.  
  15.   if (%asc isnum 55296-56319) && ($asc($mid($1, 2)) isnum 56320-57343) { var %r = $calc(65536 + (%asc - 55296) * 1024 + $v1 % 1024) }
  16.   if (!%r) { var %r = %asc }
  17.  
  18.   return $base(%r,10,16)
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement