From fc19bb8ad8b3c0a698a84fdb37298d508a384f7f Mon Sep 17 00:00:00 2001 From: Dustin Pianalto Date: Wed, 9 May 2018 15:40:34 -0800 Subject: [PATCH] Try utf-16 if utf-8 fails --- exts/imports/process_files.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exts/imports/process_files.py b/exts/imports/process_files.py index 600b62f..74692dc 100644 --- a/exts/imports/process_files.py +++ b/exts/imports/process_files.py @@ -49,7 +49,8 @@ def process_file(in_file, file_type) -> ConfigParser: bot_config = json.load(f) ignore_strings = bot_config['ignore_strings'][file_type] keep_blocks = bot_config['keep_blocks'][file_type] - data = in_file.readlines() + lines = in_file.readlines() + data = [line.decode() for line in lines] # try: # data = [line.decode(encoding='utf-8') for line in lines] # except UnicodeDecodeError as e: