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
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -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()