>> > We do however have translations for a few simple strings for the GTK+ >> > menu items, so in order to run QEMU using the C locale, and yet have a >> > translated UI let's use setlocale() for LC_MESSAGES only. >> > >> Not sure why I noticed it only now and if it's related to any recent >> package upgrade on my side (using RHEL 7), but I noticed that >> non-ASCII characters in the GTK UI strings are broken for me and git >> bisect pointed to this commit. > > I guess we need to set LC_CTYPE too.
That affects functions in ctype.h (isalpha(), islower(), isupper(), ...) I guess that's safe? > @@ -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"); You can also modify the comment in early_gtk_display_init() to say that " we support importing LC_MESSAGES and LC_CTYPE from the environment ". Berto