From f961306d40654ac6a1ab7c262af7af74401dc693 Mon Sep 17 00:00:00 2001 From: kkard2 Date: Wed, 10 Jun 2026 14:06:55 +0200 Subject: init --- src/font/iso8859_2_to_utf32.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/font/iso8859_2_to_utf32.py (limited to 'src/font/iso8859_2_to_utf32.py') 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};") -- cgit v1.3.1