Created
December 16, 2021 18:34
-
-
Save ConorOBrien-Foxx/0b5c41012830279b5ba109d9f60aec4f to your computer and use it in GitHub Desktop.
Sample implementation of a basic codepage.
This file contains hidden or 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
codepage = "⊙⊚⊛⊡⋄∘⨕⨖⨞⫇⫈αβγδεζηθι !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~←↑→↓" #... | |
unicode_result = "" | |
with open("sample.txt", "rb") as f: | |
while (byte := f.read(1)): | |
unicode_result += codepage[ord(byte)] | |
print(unicode_result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment