Created
December 24, 2023 07:29
-
-
Save gimntut/6d6bfc823db2613beb75485bca805708 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def minecraft_text(s): | |
result = '' | |
for b in s: | |
c = ord(b) | |
if c > 256: | |
b = f'\\u{hex(c)[2:].zfill(4)}' | |
result += b | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment