Merge pull request #168 from archerc/me

add support for languages other than english in the input files by opening as utf-8
这个提交包含在:
Craig Warren
2018-08-29 08:38:17 +01:00
提交者 GitHub
当前提交 ceb272cd3a

查看文件

@@ -25,6 +25,7 @@ import subprocess
from shutil import get_terminal_size from shutil import get_terminal_size
import sys import sys
import textwrap import textwrap
import codecs
from colorama import init from colorama import init
from colorama import Fore from colorama import Fore
@@ -98,7 +99,7 @@ def open_path_file(path_or_file):
""" """
if isinstance(path_or_file, str): 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: else:
f = path_or_file f = path_or_file
file_to_close = None file_to_close = None