From 8436c8449c78a5a7fbcadf3a09499f5cb684631a Mon Sep 17 00:00:00 2001 From: Tony Jurg <114746162+tonyjurg@users.noreply.github.com> Date: Mon, 2 Dec 2024 14:22:46 +0100 Subject: [PATCH] Update beta_code.py Modify the part of the beta_code.py file that opens the JSON files, explicitly specifying their encoding ( utf-8). --- beta_code/beta_code.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beta_code/beta_code.py b/beta_code/beta_code.py index cc2ab0e..5e88232 100644 --- a/beta_code/beta_code.py +++ b/beta_code/beta_code.py @@ -5,10 +5,10 @@ import re import unicodedata -with open(os.path.join(os.path.dirname(__file__), 'vendor/beta-code-json/beta_code_to_unicode.json')) as json_file: +with open(os.path.join(os.path.dirname(__file__), 'vendor/beta-code-json/beta_code_to_unicode.json'), encoding='utf-8') as json_file: BETA_CODE_TO_UNICODE_MAP = json.load(json_file) -with open(os.path.join(os.path.dirname(__file__), 'vendor/beta-code-json/unicode_to_beta_code.json')) as json_file: +with open(os.path.join(os.path.dirname(__file__), 'vendor/beta-code-json/unicode_to_beta_code.json'), encoding='utf-8') as json_file: UNICODE_TO_BETA_CODE_MAP = json.load(json_file) def greek_to_beta_code(greek, custom_map=None):