summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorTing-Wei Lan <lantw@src.gnome.org>2019-07-29 18:56:09 +0800
committerTing-Wei Lan <lantw@src.gnome.org>2019-07-29 18:56:09 +0800
commit0956ddc863111e46600fc0b1766bb6b7067d25b7 (patch)
tree47df71e9f15e74589749ac8b4bbe31b7a120889a /utils
parent3b549d4d356b21094add8186bc1f80447047c4c5 (diff)
downloadpango-0956ddc863111e46600fc0b1766bb6b7067d25b7.tar.gz
pango-list: Call setlocale in main function
If it isn't called, GLib will try to convert non-ASCII characters to ASCII because LC_CTYPE locale is C. Therefore, all non-ASCII characters are displayed as question marks because the conversion always fails.
Diffstat (limited to 'utils')
-rw-r--r--utils/pango-list.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/utils/pango-list.c b/utils/pango-list.c
index f22792df..3d360975 100644
--- a/utils/pango-list.c
+++ b/utils/pango-list.c
@@ -25,6 +25,7 @@
#include <hb-ot.h>
#include <glib/gstdio.h>
#include <stdlib.h>
+#include <locale.h>
/* FIXME: This doesn't work if the font has an avar table */
static float
@@ -61,6 +62,7 @@ main (int argc,
GError *error = NULL;
g_set_prgname ("pango-list");
+ setlocale (LC_ALL, "");
context = g_option_context_new ("");
g_option_context_add_main_entries (context, entries, NULL);