Skip to content

Instantly share code, notes, and snippets.

@ericosur
Created October 23, 2020 03:34
Show Gist options
  • Save ericosur/e0d1e993d2750e04e6729ec5457b9907 to your computer and use it in GitHub Desktop.
Save ericosur/e0d1e993d2750e04e6729ec5457b9907 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
# coding: utf-8
s = 'β€οΈπŸ‡§πŸ‡΄πŸ™‹β€β™€οΈπŸˆπŸ˜ƒ'
print(s)
line = '"'
for cc in s:
hx = hex(ord(cc)) # str, 0x1f1e7
hx = hx.upper()
hx = hx.replace('0X','\\u')
line += hx
line += '"'
print(line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment