mirror of
https://github.com/zeldaret/ph
synced 2026-05-23 15:01:37 -04:00
m2ctx.py: Read in UTF-8
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="utf8") 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