On Feb 19 08:53:15, s...@stsp.name wrote:
> On Thu, Feb 18, 2016 at 09:44:08PM +0100, Jan Stary wrote:
> > Probably not, because if I remove all my .x* files
> > and keep just the .Xdefaults -> .Xresources which
> > specifies the UTF8 locale for xterm, the same thing
> > happens in (the default) fvwm. Namely,
> > the xterm started by default has XTERM_LOCALE=C,
> > and every xterm started from fvwm's menu has XTERM_LOCALE=C,
> > but every xterm I start as `xterm` (from another xterm)
> > has XTERM_LOCALE=cs_CZ.UTF-8, as specified in.Xdefaults.
> > 
> > Why is that? Am I missing something obvious?
> > 
> >     Jan
> > 
> 
> Why don't you just set LC_CTYPE in your environment as described here?
> http://www.openbsd.org/faq/faq10.html#locales

I do. (Actually, LANG)

Only last night did I realize it's _this_ that makes them xterms UTF,
not the xterm-specific locale in my X settings (see below).

> Do you really want to set a separate UTF-8 flag for every application you use?
> I think per-application locale knobs are silly. They are legacy cruft added
> before somewhat standardized locale support was built into unix systems.
> I'm not surprised it doesn't work the way you expect. xterm needs LC_CTYPE
> set the environment when it calls setlocale(3) and/or whatever other things
> it does to set up its locale. I haven't looked at xterm code to track down
> why xrdb locale settings don't apply as you expect, and I'm not going to
> because you should really just be exporting LC_CTYPE in your xsession and
> be done with this.

That's exactly right.

Here is what I did, trying to find what's "wrong":

Set up a brand new user with nothing in his $HOME,
apart from ~/.Xdefaults -> ~/.Xresources which says

        XTerm*utf8:     true
        XTerm*locale:   UTF-8

and ~/.xsession -> ~/.xinitrc which says

        xrdb -load ~/.Xresources
        cwm

An xterm of this user will not be UTF8,
whteher started after startx or from an xdm session,
from whichever menu or cmdline. On the other hand,
if the brand new user has nothing in his $HOME
except ~/.xsession which says

        export LC_CTYPE="cs_CZ.UTF-8"
        cwm

then his xterm (and anything else, for that matter),
will be UTF, as intended.

Thank you for the insight.

Can you please elaborate on why LC_CTYPE
is the one of the LC_* family to be set?
Or does the current locale support involve
anything else then CTYPE?

        Jan

Reply via email to