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

Re: Hi, how to change the LC_CTYPE?



shiyao ma wrote:
> Once again, I added export LC_CTYPE=zh_CN.UTF-8 in my .zshrc
> However, I do not think it will affect the locale of my GUI software...

Is it an acceptable solution to set LANG=zh_CN.UTF-8 only?
If not then I will suggest a more complicated but robust solution.

It appears that setting LANG works but setting LC_CTYPE does not.  I
just tried the experiment.  I ran 'dpkg-reconfigure locales' and make
zh_CN.UTF-8 available.  Then I tried having only LC_CTYPE set and
having only LANG set in /etc/default/locale.  Having LANG set
propagated the value successfully.  Having only LC_CTYPE set did not.

Having /etc/default/locale set LANG enables /etc/init.d/lightdm to
load the file.  Then children of lightdm inherit the variable.

Tom H wrote:
> With bash, you'd edit "/etc/profile" or "~/.profile"; with zsh, no idea.

That won't work for logins from an xdm such as gdm, kdm or lightdm.
Those are not in the execution path.  Shells launched are not login
shells and nowhere in the path (by default) are any shells a login
shell and therefore no sourcing of any profile will ever happen.

There are customizations that can be done to make shells login shells
or to have the entire xsession run from a login shell.  (I think
making .xsession run as a login shell is the best solution.  I have
posted about it several times before.)  But by default adding
variables to /etc/profile won't in your shell environment.  And
neither will it show up for any applications launched from the desktop
menu.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: