SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
When /etc/profile is run it sources /etc/profile.d/lang.sh which sets envar $LANG but /etc/profile is only used by login shells so -- AFAIK -- modifying $LANG in /etc/profile.d/lang.sh will not change the system locale for processes started by the boot scripts.
There are no *locale* files under /etc.
/etc/inittab has nothing about locale.
man init has nothing about locale.
man 7 locale describes locale.h and its usage.
man 5 locale describes the format of locale files.
/sbin/init (as investigated using the strings command) may call nl_langinfo but man nl_langinfo only describes how to query the locale, not where it is set.
Good question, especialy as /etc/profile.d/lang.sh includes the comment:
Code:
# There is also support for UTF-8 locales, but be aware that
# some programs are not yet able to handle UTF-8 and will fail to
# run properly. In those cases, you can set LANG=C before
# starting them. Still, I'd avoid UTF unless you actually need it.
Unfortunately it is atually needed, for Bacula. According to the Bacula Main Reference (available as PDF or HTML at http://www.bacula.org/en/?page=documentation), in the "13.1 Critical Items" section: "Bacula assumes all filenames are in UTF-8 format. This is important when saving the filenames to the catalog. For Win32 machine, Bacula will automatically convert from Unicode to UTF-8, but on Unix, Linux, *BSD, and MacOS X machines, you must explicitly ensure that your locale is set properly. Typically this means that the bf LANG environment variable must end in .UTF-8. An full example is en US.UTF-8. The exact syntax may vary a bit from OS to OS, and exactly how you define it will also vary."
It would be nice to set it for Bacula only but that would require front-ending a lot of executables and I'm not confident of being able to identify them all. Actually it would be very nice because setting $LANG to en_GB.UTF-8 (the closest available for Indian English) is already causing breakage:
mrxvt (terminal emulator) positions the CLI cursor incorrectly and cannot do command line editing. It does not support UTF-8 so that's fair enough. Unfortuantely I'll have to change terminal emulator and that is likely to require a lot of time to get the new one set up and working nicely.
dvd+rw-format is outputting unexpected characters which broke the locally written backup script until fixed with export LANG=en_US.
Good question, especialy as /etc/profile.d/lang.sh includes the comment:
Code:
# There is also support for UTF-8 locales, but be aware that
# some programs are not yet able to handle UTF-8 and will fail to
# run properly. In those cases, you can set LANG=C before
# starting them. Still, I'd avoid UTF unless you actually need it.
This statement really is outdated nowadays. It's just the other way round: you SHOULD use UTF-8 whereever it's possible, and - believe me - you want it. ;-)
Just put "en_US.UTF-8" in there (or whatever language your're using). And add "vt.default_utf8=1" to your kernel boot parameters ('append=" ..."' in lilo.conf).
This statement really is outdated nowadays. It's just the other way round: you SHOULD use UTF-8 whereever it's possible, and - believe me - you want it. ;-)
Just put "en_US.UTF-8" in there (or whatever language your're using). And add "vt.default_utf8=1" to your kernel boot parameters ('append=" ..."' in lilo.conf).
Thanks Rupa
Surely UTF-8 is the way to go but when Slackware comes with a warning like that, I anticipate some pain!
I've done as you suggested. Is that "vt" as in "virtual terminal"?
I'm still puzzled about how locale is set by init and hence for processes started during boot.
Surely UTF-8 is the way to go but when Slackware comes with a warning like that, I anticipate some pain!
I have used utf8 for some time now, and the only programs I've had issues with are a few ncurses based programs. However, I only use a very few programs, so who am I to say anything?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.