From: Dominik George <natureshadow@debian.org>
Date: Tue, 31 Dec 2019 11:04:57 +0200
Subject: Fix unicode in Sphinx output

Forwarded: https://github.com/pygame/pygame/pull/1544
---
 docs/reST/ext/headers.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/reST/ext/headers.py b/docs/reST/ext/headers.py
index 06cec09..3c1df22 100644
--- a/docs/reST/ext/headers.py
+++ b/docs/reST/ext/headers.py
@@ -42,7 +42,7 @@ def writer(app, pagename, templatename, context, doctree):
     filename = '%s%s.h' % (os.path.basename(pagename), filename_suffix)
     filepath = os.path.join(dirpath, filename)
     template = app.config['headers_template']
-    header = open(filepath, 'w')
+    header = open(filepath, 'w', encoding='utf-8')
     context['hdr_items'] = items
     try:
         header.write(templates.render(template, context))
