From eef9e470c9af009a101c32bddadc69c3e7a4ac96 Mon Sep 17 00:00:00 2001 From: qingxu fu <505030475@qq.com> Date: Tue, 18 Jul 2023 11:00:20 +0800 Subject: [PATCH] =?UTF-8?q?Latex=E8=A7=A3=E9=99=A4=E9=9D=9EUTF8=E7=BC=96?= =?UTF-8?q?=E7=A0=81=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crazy_functions/latex_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crazy_functions/latex_utils.py b/crazy_functions/latex_utils.py index 003d474..9437559 100644 --- a/crazy_functions/latex_utils.py +++ b/crazy_functions/latex_utils.py @@ -147,7 +147,7 @@ def 寻找Latex主文件(file_manifest, mode): for texf in file_manifest: if os.path.basename(texf).startswith('merge'): continue - with open(texf, 'r', encoding='utf8') as f: + with open(texf, 'r', encoding='utf8', errors='ignore') as f: file_content = f.read() if r'\documentclass' in file_content: canidates.append(texf) @@ -165,7 +165,7 @@ def 寻找Latex主文件(file_manifest, mode): expected_words = ['\input', '\ref', '\cite'] for texf in canidates: canidates_score.append(0) - with open(texf, 'r', encoding='utf8') as f: + with open(texf, 'r', encoding='utf8', errors='ignore') as f: file_content = f.read() for uw in unexpected_words: if uw in file_content: