From e5f76713baa4dfeffd0667fbe35c612b6590e269 Mon Sep 17 00:00:00 2001 From: archerC Date: Wed, 29 Aug 2018 12:32:44 +0800 Subject: [PATCH] to allow open input files with commentary text written in asian language by opening files with encoding utf-8 --- gprMax/utilities.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gprMax/utilities.py b/gprMax/utilities.py index 0a64bbac..8656d314 100644 --- a/gprMax/utilities.py +++ b/gprMax/utilities.py @@ -25,6 +25,7 @@ import subprocess from shutil import get_terminal_size import sys import textwrap +import codecs from colorama import init from colorama import Fore @@ -98,7 +99,7 @@ def open_path_file(path_or_file): """ if isinstance(path_or_file, str): - f = file_to_close = open(path_or_file, 'r') + f = file_to_close = codecs.open(path_or_file, 'r', encoding='utf-8') else: f = path_or_file file_to_close = None