From c214834d28985de37ecb75ac563057240a77465c Mon Sep 17 00:00:00 2001 From: Yabin Zheng Date: Thu, 1 Dec 2016 20:37:47 +0800 Subject: [PATCH] fix encoding bug when dealing with unicode list file. --- utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.py b/utils.py index b68985db..a4210a30 100644 --- a/utils.py +++ b/utils.py @@ -54,5 +54,5 @@ def gen_keywords_list_from_str(keywords_str, sep=","): def gen_keywords_list_from_file(filepath): - with open(filepath, "r") as f: + with open(filepath, "r", encoding="utf-8") as f: return f.readlines()