diff options
| author | kkard2 <[email protected]> | 2026-06-10 14:06:55 +0200 |
|---|---|---|
| committer | kkard2 <[email protected]> | 2026-06-10 14:06:55 +0200 |
| commit | f961306d40654ac6a1ab7c262af7af74401dc693 (patch) | |
| tree | 6e2b0366f0ec077eadb815b35718312d1c79ea33 /src/font/iso8859_2_to_utf32.py | |
init
Diffstat (limited to 'src/font/iso8859_2_to_utf32.py')
| -rw-r--r-- | src/font/iso8859_2_to_utf32.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/font/iso8859_2_to_utf32.py b/src/font/iso8859_2_to_utf32.py new file mode 100644 index 0000000..664239b --- /dev/null +++ b/src/font/iso8859_2_to_utf32.py @@ -0,0 +1,18 @@ +from encodings import iso8859_2 + +table = [] + +for ch in iso8859_2.decoding_table: # length = 256 + if ch == '\ufffd': # undefined bytes (if any) + table.append(0x0000) # or 0xFFFD if you prefer + else: + table.append(ord(ch)) + +print("static const uint32_t iso8859_2_to_utf32[256] = {") +for i, v in enumerate(table): + if i % 8 == 0: + print(" ", end="") + print(f"0x{v:04X}, ", end="") + if i % 8 == 7: + print() +print("\n};") |
