From e47caddeb04e758b1ebc6bd1a5e1ec811baef786 Mon Sep 17 00:00:00 2001 From: piotrva Date: Mon, 17 Jan 2022 02:24:53 +0100 Subject: [PATCH] fix: Force translation.py script encoding to utf-8 (#1424) --- radio/src/translations/translation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/translations/translation.py b/radio/src/translations/translation.py index 70e631279..b2977fb8e 100755 --- a/radio/src/translations/translation.py +++ b/radio/src/translations/translation.py @@ -10,7 +10,7 @@ TRANSLATIONS_PATH = os.path.dirname(os.path.realpath(__file__)) def add_line(filename, newline, args): print(filename, newline) - with open(filename, "r") as f: + with open(filename, encoding='utf-8', mode='r') as f: lines = f.readlines() newline += "\n" if args.before: @@ -25,7 +25,7 @@ def add_line(filename, newline, args): break else: lines.append(newline) - with open(filename, 'w') as f: + with open(filename, encoding='utf-8', mode='w') as f: f.writelines(lines)