diff options
| author | Autissima | 2025-09-03 22:41:10 +0200 |
|---|---|---|
| committer | GitHub | 2025-09-03 22:41:10 +0200 |
| commit | 5b3dc8d5ed4d73d5fa7bb8028d467a923dfbd191 (patch) | |
| tree | 8e7833bf62101f73a699de8ed1d76e667796008b /gen_layouts.py | |
| parent | 795889bf813d5c561725c2ca39597d04f33a63cd (diff) | |
| download | unexpected-keyboard-5b3dc8d5ed4d73d5fa7bb8028d467a923dfbd191.tar.gz unexpected-keyboard-5b3dc8d5ed4d73d5fa7bb8028d467a923dfbd191.zip | |
Python script encoding fix (#1093)
* Changed Python scripts so they work on my machine
file open() used default encoding (cp1252 on my machine) but the text is utf-8, had to specify encoding in check_layout.py
Diffstat (limited to 'gen_layouts.py')
| -rw-r--r-- | gen_layouts.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gen_layouts.py b/gen_layouts.py index 6cae361..a755844 100644 --- a/gen_layouts.py +++ b/gen_layouts.py @@ -57,8 +57,8 @@ def generate_arrays(out, layouts): root.append(mk_array("string-array", "pref_layout_entries", entries_items)) root.append(mk_array("integer-array", "layout_ids", ids_items)) XML.indent(root) - XML.ElementTree(element=root).write(out, encoding="unicode", xml_declaration=True) + XML.ElementTree(element=root).write(out, encoding="utf-8", xml_declaration=True) layouts = sort_layouts(read_layouts(glob.glob("srcs/layouts/*.xml"))) -with open("res/values/layouts.xml", "w") as out: - generate_arrays(out, layouts) +with open("res/values/layouts.xml", "wb") as out: + generate_arrays(out, layouts)
\ No newline at end of file |
