mirror of
https://github.com/EdgeTX/edgetx.git
synced 2025-07-14 11:59:49 +03:00
Add script to compile used characters by translation
This commit is contained in:
parent
8639a7829d
commit
9aa1a672f4
1 changed files with 38 additions and 0 deletions
38
tools/list-utf-8-code-points.py
Executable file
38
tools/list-utf-8-code-points.py
Executable file
|
@ -0,0 +1,38 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import argparse
|
||||
import codecs
|
||||
import sys
|
||||
from charset import special_chars, get_chars_encoding, special_chars_BW, get_chars_encoding_BW
|
||||
|
||||
all_languages = special_chars.keys()
|
||||
|
||||
def main():
|
||||
|
||||
languages = ""
|
||||
char_list = []
|
||||
|
||||
lang_args = all_languages
|
||||
if len(sys.argv) > 1:
|
||||
lang_args = sys.argv[1:]
|
||||
|
||||
for lang in lang_args:
|
||||
if lang not in special_chars:
|
||||
print(lang + ' is not a supported language. Try one of the supported ones: %s' % list(special_chars.keys()))
|
||||
sys.exit()
|
||||
|
||||
languages += ' ' + lang
|
||||
char_list.extend(c for c in get_chars_encoding(lang).keys())
|
||||
|
||||
|
||||
char_list = sorted(set(char_list))
|
||||
chars = ""
|
||||
for c in char_list:
|
||||
if ord(c) < 0x10000 or ord(c) > 0x10014:
|
||||
chars = chars + hex(ord(c)) + ','
|
||||
|
||||
print(f"{languages}: {chars}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue