Skip to content
Snippets Groups Projects
Commit f07346bc authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

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

parent 9caf2dbd
Branches
No related tags found
No related merge requests found
...@@ -61,7 +61,8 @@ def processDocument(args:argparse.Namespace) -> None: ...@@ -61,7 +61,8 @@ def processDocument(args:argparse.Namespace) -> None:
# Read the document # Read the document
headers:list[Tuple[str, int]] = [] headers:list[Tuple[str, int]] = []
with open(args.document, 'r') as f: # Note: We use utf-8 and replace errors to avoid problems with special or unknown characters.
with open(args.document, 'r', encoding='utf-8', errors='replace') as f:
document = f.readlines() document = f.readlines()
for line in document: for line in document:
_l = line.strip() _l = line.strip()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment