summaryrefslogtreecommitdiff
path: root/tools/m2ctx.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/m2ctx.py')
-rwxr-xr-xtools/m2ctx.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/m2ctx.py b/tools/m2ctx.py
index 64186fa6..9684424f 100755
--- a/tools/m2ctx.py
+++ b/tools/m2ctx.py
@@ -36,7 +36,7 @@ INCLUDE_REGEX = r'^\s*#\s*include\s*([<"][\S ]+[>"])\s*$'
# Finds all line comments and multiline comments
COMMENT_REGEX = r'\/\/.*$|\/\*(?:.|\r|\n)+?\*\/'
-with open(args.file, 'r', encoding="utf8") as f:
+with open(args.file, 'r', encoding=args.encoding) as f:
contents = f.read()
contents = re.sub(COMMENT_REGEX, '', contents, count=0, flags=re.MULTILINE)
includes = re.findall(INCLUDE_REGEX, contents, flags=re.MULTILINE)