Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; $hex2emoji(2764)
- ; $emoji2hex(❤️)
- alias hex2emoji {
- var %u = $base($1,16,10)
- if (%u isnum 0-65535) { return $chr($v1) }
- return $+($chr($calc((%u -65536)//1024 +55296)),$chr($calc((%u -65536)% 1024 +56320)))
- }
- alias emoji2hex {
- var %asc = $asc($1)
- if (%asc isnum 55296-56319) && ($asc($mid($1, 2)) isnum 56320-57343) { var %r = $calc(65536 + (%asc - 55296) * 1024 + $v1 % 1024) }
- if (!%r) { var %r = %asc }
- return $base(%r,10,16)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement