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>
This commit is contained in:
Uli Schlachter 2023-09-17 12:43:43 +02:00 committed by Matt Turner
parent 389f22d1cb
commit b78d304531

View File

@ -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)