summaryrefslogtreecommitdiff
path: root/boilerplate
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2021-02-23 23:42:11 +0000
committerTim-Philipp Müller <tim@centricular.com>2021-02-23 23:42:11 +0000
commit9732f4e80f906fab85b97ae55ee44bfd3ee4945e (patch)
tree179a01a01190f727b9432d9989951134c6f0f1d7 /boilerplate
parentd85738b39c2fe01ec09b83d2e1b88fa918939a01 (diff)
downloadcairo-9732f4e80f906fab85b97ae55ee44bfd3ee4945e.tar.gz
meson: use encoding=utf-8 when reading/writing files in helper script
Fixes errors such as Traceback (most recent call last): File "C:\Users\...\cairo\test\make-cairo-test-constructors.py", line 19, in <module> for l in f.readlines(): File "c:\python39\lib\encodings\cp1253.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 6694: character maps to <undefined> on non-English-language Windows locales/installations.
Diffstat (limited to 'boilerplate')
-rw-r--r--boilerplate/make-cairo-boilerplate-constructors.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/boilerplate/make-cairo-boilerplate-constructors.py b/boilerplate/make-cairo-boilerplate-constructors.py
index 8e02fa500..40198ed1a 100644
--- a/boilerplate/make-cairo-boilerplate-constructors.py
+++ b/boilerplate/make-cairo-boilerplate-constructors.py
@@ -16,12 +16,12 @@ if __name__=='__main__':
match_boilerplate_name = re.compile(r'^CAIRO_BOILERPLATE.*\((.*),.*')
for fname in args.input:
- with open(fname, 'r') as f:
+ with open(fname, 'r', encoding='utf-8') as f:
for l in f.readlines():
if match_boilerplate_line.match(l):
boilerplate_names.append(match_boilerplate_name.match(l).group(1))
- with open(args.output, 'w') as f:
+ with open(args.output, 'w', encoding='utf-8') as f:
f.write('/* WARNING: Autogenerated file - see %s! */\n\n' % sys.argv[0])
f.write('#include "cairo-boilerplate-private.h"\n\n')
f.write('void _cairo_boilerplate_register_all (void);\n\n')