Received: from eggs.gnu.org ([2001:4830:134:3::10]:57019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aA17a-0006pK-UI for qemu-devel@nongnu.org; Fri, 18 Dec 2015 14:55:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aA17W-00053Z-U7 for qemu-devel@nongnu.org; Fri, 18 Dec 2015 14:55:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aA17W-00053V-Of for qemu-devel@nongnu.org; Fri, 18 Dec 2015 14:55:18 -0500 From: Markus Armbruster References: <1441898372-32679-1-git-send-email-berto@igalia.com> <20151218113844.GA31910@noname.redhat.com> <1450445013.15674.38.camel@redhat.com> Date: Fri, 18 Dec 2015 20:55:15 +0100 In-Reply-To: (Alberto Garcia's message of "Fri, 18 Dec 2015 19:04:20 +0100") Message-ID: <878u4ry1jw.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] gtk: use setlocale() for LC_MESSAGES only List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia Cc: Kevin Wolf , Gerd Hoffmann , qemu-devel@nongnu.org Alberto Garcia writes: >>> > 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? If we're guessing, then I guess it isn't. But we shouldn't be guessing. "LC_CTYPE affects the behavior of the character handling functions and the multibyte and wide character functions." I doubt there's much use for the latter in QEMU itself, but in libraries, all bets are off. I guess this is what actually screws up GTK. We do use the former. LC_CTYPE set to some sufficiently funky locale is bound to upset these uses. In short: nope, we can't just set LC_CTYPE, at least not without further analysis. We should've stayed out of the GUI business. [...]