glib2: backport locale fix
authorRosen Penev <rosenp@gmail.com>
Thu, 22 Sep 2022 18:51:35 +0000 (11:51 -0700)
committerRosen Penev <rosenp@gmail.com>
Fri, 23 Sep 2022 03:49:27 +0000 (20:49 -0700)
Fixes compilation with non English locale.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
libs/glib2/patches/020-locale.patch [new file with mode: 0644]

diff --git a/libs/glib2/patches/020-locale.patch b/libs/glib2/patches/020-locale.patch
new file mode 100644 (file)
index 0000000..e171d58
--- /dev/null
@@ -0,0 +1,24 @@
+From ebcc3c01db27b79af38b42c3c52a79d0225f744c Mon Sep 17 00:00:00 2001
+From: Seungha Yang <seungha@centricular.com>
+Date: Sun, 14 Aug 2022 04:56:20 +0900
+Subject: [PATCH] glib-mkenums: Specify output encoding as UTF-8 explicitly for
+ non-English locale
+
+Fixup regression introduced by
+https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2797
+---
+ gobject/glib-mkenums.in | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/gobject/glib-mkenums.in
++++ b/gobject/glib-mkenums.in
+@@ -19,6 +19,9 @@ import errno
+ import codecs
+ import locale
++# Non-english locale systems might complain to unrecognized character
++sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding='utf-8')
++
+ VERSION_STR = '''glib-mkenums version @VERSION@
+ glib-mkenums comes with ABSOLUTELY NO WARRANTY.
+ You may redistribute copies of glib-mkenums under the terms of