diff options
| author | Aetias <aetias@outlook.com> | 2025-05-10 20:24:13 +0200 |
|---|---|---|
| committer | Aetias <aetias@outlook.com> | 2025-05-10 20:24:13 +0200 |
| commit | b4cd6ce4d7e247af857d262f983c4f69fff03bef (patch) | |
| tree | 2dad3e70bcc23c99b3ce707004062c78fd3a26c7 /tools | |
| parent | 218dc0ea38f39e38f7f2c4157c0a28d98245ff76 (diff) | |
m2ctx.py: Read in UTF-8
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/m2ctx.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/m2ctx.py b/tools/m2ctx.py index 7c20c34a..64186fa6 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') 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) |
