tech-x11 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Fun with locales



Bah, I misedited the message and managed to lose the solution part.

On Mon, Jun 30, 2025 at 18:10:26 +0300, Valery Ushakov wrote:

> On Fri, Jun 27, 2025 at 14:02:21 -0500, John D. Baker wrote on netbsd-users:
> 
> > Some time ago, I learned that for GTK applications to choose "US Letter"
> > as the default paper size, I need to set something like "LANG=en_US.foo".
> > 
> > I chose "en_US.US-ASCII".  That seemed to work.
> > 
> > Some applications, however, take exception to this locale and throw
> > interesting errors.  Namely 'xlock' (x11/xlockmore) fails, complaining
> > about "Can't create FontSet blahblahblah,xyzzy" and some of the font
> > strings it prints look rather broken.  There also appears to be a typo
> > somewhere and it also displays a message with "fonset" (sic).
> > 
> > It worked fine for another user account on my system, but wasn't working
> > any more for my regular account.
> > 
> > The only change I'd made was setting "LANG=en_US.US-ASCII" in my
> > '.xsession' script.  Unsetting LANG entirely allowed 'xlock' to work.
> > Setting LANG=en_US.UTF-8 allows it to work also.
> > 
> > Just a little note about something I observed.
> 
> We probably should make sure that all system locales from
> /usr/share/locale are also recognized by X11 /usr/X11R7/lib/X11/locale
> 
[...]
>   en_US.US-ASCII	 C
> 
> added at the beginning of /usr/X11R7/lib/X11/locale/locale.alias
> didn't help much...

I'm not sure why /usr/X11R7/lib/X11/locale/locale.alias has the same
set of alias pairs twice, once with, and once without the colon.  The
pairs with the colon is what libX11 really reads, so the solution is
to add

    en_US.US-ASCII: C

alias.

The line w/out the colon is not necessary for libX11, but you might
want to also add

    en_US.US-ASCII  C

for cargo cult.

-uwe


Home | Main Index | Thread Index | Old Index