diff options
author | Christoph Reiter <reiter.christoph@gmail.com> | 2020-11-07 08:41:42 +0100 |
---|---|---|
committer | Christoph Reiter <reiter.christoph@gmail.com> | 2020-11-07 08:57:06 +0100 |
commit | 5f966b0b8d61e2abf003439b2f93a9bd19be798c (patch) | |
tree | 530128d2a9ee1a0b4cd3c9702d5de5862943aa1f /giscanner/codegen.py | |
parent | 19c67f77e23cf80da957bfa0b28c1b31d81339f0 (diff) | |
download | gobject-introspection-5f966b0b8d61e2abf003439b2f93a9bd19be798c.tar.gz |
Always pass an encoding to open() using text mode
Otherwise we'll end up using the locale encoding. While it's usually utf-8,
that's not the case on Windows.
There is one place where a file with filenames is passed, not sure there
so I left it and passed a explicit None.
Diffstat (limited to 'giscanner/codegen.py')
-rw-r--r-- | giscanner/codegen.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/giscanner/codegen.py b/giscanner/codegen.py index 138acf72..9faf3cab 100644 --- a/giscanner/codegen.py +++ b/giscanner/codegen.py @@ -161,8 +161,8 @@ class CCodeGenerator(object): self._function_bodies[node] = body def codegen(self): - self.out_h = open(self.out_h_filename, 'w') - self.out_c = open(self.out_c_filename, 'w') + self.out_h = open(self.out_h_filename, 'w', encoding='utf-8') + self.out_c = open(self.out_c_filename, 'w', encoding='utf-8') self._codegen_start() |