Skip to content

Commit

Permalink
Latex解除非UTF8编码错误
Browse files Browse the repository at this point in the history
  • Loading branch information
binary-sky committed Jul 18, 2023
1 parent 3002c63 commit eef9e47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crazy_functions/latex_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:
Expand Down

0 comments on commit eef9e47

Please sign in to comment.