From def97f658c016d4c50fe9d682265841154eb5336 Mon Sep 17 00:00:00 2001 From: HideLord Date: Sun, 12 Mar 2023 02:54:22 +0200 Subject: [PATCH] Small patch to fix loading of character jsons. Now it correctly reads non-ascii characters on Windows. --- modules/chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/chat.py b/modules/chat.py index f40f8299..4a7fb873 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -332,7 +332,7 @@ def load_character(_character, name1, name2): shared.history['visible'] = [] if _character != 'None': shared.character = _character - data = json.loads(open(Path(f'characters/{_character}.json'), 'r').read()) + data = json.loads(open(Path(f'characters/{_character}.json'), 'r', encoding='utf-8').read()) name2 = data['char_name'] if 'char_persona' in data and data['char_persona'] != '': context += f"{data['char_name']}'s Persona: {data['char_persona']}\n"