From 790add39113b7d9988b65fefd72c06ce1916f578 Mon Sep 17 00:00:00 2001 From: croneter Date: Sat, 20 Mar 2021 14:02:42 +0100 Subject: [PATCH] Fix encoding --- .tx/import_strings_to_addon_xml.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.tx/import_strings_to_addon_xml.py b/.tx/import_strings_to_addon_xml.py index cc88d657..707164a2 100644 --- a/.tx/import_strings_to_addon_xml.py +++ b/.tx/import_strings_to_addon_xml.py @@ -65,11 +65,11 @@ for lang in languages: 'resources', 'language', 'resource.language.%s' % lang, - 'strings.po'), 'rb') as f: + 'strings.po'), 'r', encoding='utf-8') as f: for line in f: if line.strip() in addon: msg = '' - key = str(line.strip()) + key = line.strip() # Advance to the line msgstr "" part = '' while not part.startswith('msgstr'): @@ -83,7 +83,7 @@ for lang in languages: print(msg) etree.SubElement(root, addon[key], - attrib={'lang': lang}).text = msg.decode('utf-8') + attrib={'lang': lang}).text = msg except IOError: print('Missing file %s' % os.path.join(PKC_dir, 'resources',