summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorUli Schlachter <psychon@znc.in>2023-09-17 12:43:43 +0200
committerMatt Turner <mattst88@gmail.com>2024-04-15 14:40:41 +0000
commitb78d304531bfe2359baf40db06099d9158d398d4 (patch)
tree1ee956f3702c24e0839df2169f12413a99175883 /src
parent389f22d1cb53e47337e96d9f78a3ef0001e8e588 (diff)
Always write C code in UTF-8
Some people apparently use non-utf8 locales and this caused errors when xcb-proto started using some "fancy" quote marks. Fix this by always using utf8 encoding. Fixes: https://gitlab.freedesktop.org/xorg/lib/libxcb/-/issues/72 Signed-off-by: Uli Schlachter <psychon@znc.in>
Diffstat (limited to 'src')
-rw-r--r--src/c_client.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/c_client.py b/src/c_client.py
index 182b5de..b7db543 100644
--- a/src/c_client.py
+++ b/src/c_client.py
@@ -331,7 +331,7 @@ def c_close(self):
_h(' */')
# Write header file
- hfile = open('%s.h' % _ns.header, 'w')
+ hfile = open('%s.h' % _ns.header, 'w', encoding='UTF-8')
for list in _hlines:
for line in list:
hfile.write(line)
@@ -339,7 +339,7 @@ def c_close(self):
hfile.close()
# Write source file
- cfile = open('%s.c' % _ns.header, 'w')
+ cfile = open('%s.c' % _ns.header, 'w', encoding='UTF-8')
for list in _clines:
for line in list:
cfile.write(line)