Skip to content
Snippets Groups Projects
Commit 001d4d9e authored by Andreas Kraft's avatar Andreas Kraft
Browse files

Open input file in error-replace mode to ignore and replace unknown character

parent 7ee42365
Branches
Tags
No related merge requests found
...@@ -133,7 +133,9 @@ def analyseMarkdown(filename:str) -> list[Clause]: ...@@ -133,7 +133,9 @@ def analyseMarkdown(filename:str) -> list[Clause]:
print(f'[green]Analyzing "{filename}"') print(f'[green]Analyzing "{filename}"')
with open(filename, 'r') as file: # Read the file.
# Note: We use utf-8 and replace errors to avoid problems with special or unknown characters.
with open(filename, 'r', encoding = 'utf-8', errors = 'replace') as file:
inLines = file.readlines() inLines = file.readlines()
outClauses:list[Clause] = [Clause(0, '', '', [])] outClauses:list[Clause] = [Clause(0, '', '', [])]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment