Skip to content

Instantly share code, notes, and snippets.

@amiskov
Created June 2, 2020 20:17
Show Gist options
  • Save amiskov/5d6c0181c590e44816dae409d1b19dd6 to your computer and use it in GitHub Desktop.
Save amiskov/5d6c0181c590e44816dae409d1b19dd6 to your computer and use it in GitHub Desktop.
Convert list of emojis to unicode escape symobls in Elm Char format.
#! /usr/bin/env python
# -*- coding: utf-8 -*-
emojis = "πŸ˜„πŸ˜˜πŸ˜ΊπŸš€πŸš—πŸš™πŸššπŸŒ€πŸŒŸπŸŒ΄πŸŒ΅πŸŒ·πŸŒΈπŸŒΉπŸŒΊπŸŒ»πŸŒΌπŸŒ½πŸŒΏπŸπŸ„πŸ…πŸ†πŸ‡πŸˆπŸ‰πŸŠπŸŒπŸπŸŽπŸπŸ‘πŸ’πŸ“πŸ­πŸ―πŸŽ€πŸŽƒπŸŽˆπŸŽ¨πŸŽ²πŸŽΈπŸ‘πŸŒπŸ’πŸšπŸžπŸ¬πŸ±πŸ²πŸ³πŸ΄πŸ΅πŸΆπŸΈπŸΉπŸ’œπŸ˜ŽπŸš˜πŸŒ³πŸ‹πŸ"
for e in emojis:
print(f'\\u{{{ord(e):X}}}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment