From 4d2f15c91a30eb5dfa2a1ea83f1f5376b7ef68a8 Mon Sep 17 00:00:00 2001 From: bing Date: Thu, 11 Jun 2020 19:27:24 +0800 Subject: [PATCH] fix file encoding --- YEDDA.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/YEDDA.py b/YEDDA.py index 1e47d11..ecb55bd 100644 --- a/YEDDA.py +++ b/YEDDA.py @@ -651,10 +651,10 @@ def generateSequenceFile(self): if not dlg.confirmed: print("Operation canceled") return - fileLines = open(self.fileName, 'r').readlines() + fileLines = open(self.fileName, 'r', encoding=self.file_encoding).readlines() lineNum = len(fileLines) new_filename = self.fileName.split('.ann')[0] + '.' + dlg.tag_scheme().lower() - seqFile = open(new_filename, 'w') + seqFile = open(new_filename, 'w', encoding=self.file_encoding) for line in fileLines: if len(line) <= 2: seqFile.write('\n')