Skip to contentSkip to conversation

gtk: fix utf8 strings in the ui

PATCH New Gerd Hoffmann 1 participant 1 message Dec 18, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gtk: fix utf8 strings in the ui

Commit "2cb5d2a gtk: use setlocale() for LC_MESSAGES only" restricts locate settings to LC_MESSAGES, to avoid bugs caused by locale-specific number printing (LC_NUMERIC) and possibly others.

We need LC_CTYPE too to make messages with chars outside us-ascii work correctly. Add it.

---
 ui/gtk.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
ui/gtk.c +2 -1
index 47b37e1..30407a5 100644
@@ -2044,8 +2044,9 @@ void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover)
 
     s->free_scale = FALSE;
 
-    /* LC_MESSAGES only. See early_gtk_display_init() for details */
+    /* LC_MESSAGES+LC_CTYPE only. See early_gtk_display_init() for details */
     setlocale(LC_MESSAGES, "");
+    setlocale(LC_CTYPE, "");
     bindtextdomain("qemu", CONFIG_QEMU_LOCALEDIR);
     textdomain("qemu");
 
Signature · 1 line
1.8.3.1