mirror of
https://github.com/zeldaret/ph
synced 2026-06-06 03:28:47 -04:00
m2ctx.py: Specify input encoding
This commit is contained in:
+1
-1
@@ -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') 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)
|
||||
|
||||
Reference in New Issue
Block a user