[PATCH weston v2] clients: Add XKB compose key support

Ran Benita ran234 at gmail.com
Fri Oct 7 21:07:00 UTC 2016


On Fri, Oct 07, 2016 at 12:56:00PM -0700, Bryce Harrington wrote:
> On Fri, Oct 07, 2016 at 02:48:41PM +0300, Ran Benita wrote:
> > > +	/* Look up the appropriate locale, or use "C" as default */
> > > +	locale = getenv("LC_ALL");
> > > +	if (!locale)
> > > +		locale = "C";
> > 
> > Is there a reason why you decided not to use the "full" procedure, i.e.
> > also try LC_CTYPE and LANG?
> 
> No particular reason.  I did wonder if it would be worthwhile to check
> those too, but wasn't sure what order they should be checked.  Should it
> be LANG first, then LC_CTYPE, and then fallback to LC_ALL?

I got the order from locale(7):

    If the second argument to setlocale(3) is an empty string, "",
    for the default locale, it is determined using the following
    steps:

    1.     If there is a non-null environment variable LC_ALL, the
           value of LC_ALL is used.

    2.     If  an  environment variable with the same name as one of
           the categories above exists and is non-null, its value is
           used for that category.

    3.     If there is a non-null environment variable LANG, the
           value of LANG is used.

at step 2, the relevant category in this case is LC_CTYPE. So
LC_ALL -> LC_CTYPE -> LANG -> "C".

Ran


More information about the wayland-devel mailing list