Jens Olav Nygaard wrote:
I have been lucky enough to have everything to do with local
characters "just work" for many a year... But now I find myself
having to look into this "locale-thing".
My emacs will display special Norwegian characters in X for older
files. But it simply ignores keypresses on the keys with these
characters imprinted on them.
I noticed that my installation has no directory
/usr/X11R6/lib/X11/locale at all, but if I just copy this over from
my old host, everything seems to be back to "just working"...
Recompile X. Xorg 6.7.x created a similar type of breakage for
LFS-6.0-pre2 livecd. Xorg 6.8.2 is almost good.
However, that's good but not perfect, so I searched and found several
'locale'-directories on the new system:
/usr/local/share/locale, /usr/lib/locale and /usr/share/locale
/usr/lib/locale -> part of glibc. Contains
/usr/lib/locale/locale-archive file, which is the archive containing all
locales installed in the system. These locales contain information how
to classify and sort characters, map them to Unicode, format numbers,
dates and monetary amounts. These locales are generated using the
"localedef" command by combining the definitions in
/usr/share/i18n/locales with character maps in /usr/share/i18n/charmaps
(both directories are filled by glibc only).
/usr/share/locale -> contains files from many packages. Files ending in
.mo contain translated messages.
/usr/local/share/locale -> the same, for programs installed into /usr/local
/usr/X11R6/lib/X11/locale -> part of Xorg, contains locale-related
information specific to X11 (e.g. rules of character composition).
So, now I wonder...
1) Who installs this, and missed it in my system? X? I could not find
any clues scanning the topmost levels of the LFS+BLFS books for the
term "locale".
See above. Locale support has been added to LFS only recently, and in
the form "do this, fill in the blanks (you should know how), and it will
just work", not as some in-depth overview. But hey, the same applies to
other aspects as well.
http://www.linuxfromscratch.org/lfs/view/6.1/chapter07/console.html
http://www.linuxfromscratch.org/lfs/view/6.1/chapter07/inputrc.html
http://www.linuxfromscratch.org/lfs/view/6.1/chapter07/profile.html
2) How can I get this right? Has some part of my system installed the
sensible things under /usr/lib but just forgot to tell X about it?
If so, I guess I can just fix it with a soft link.
Rebuild Xorg.
3) What is the best source of information on this?
Reverse-engineering distros. They are supposed to set everything up
correctly for you. But while investigating a distro setup, bear in mind
that UTF-8 based locales are not supported in LFS (mostly because of
upstream bugs and the desire to stay as close to upstream as possible
without build failures).
4) What should I set my LC_*, LANG and similar (if there more) variables
to? I guess maybe I will have to figure that out from (3) above...
Yes, you have to either figure from a distro setup, or from
localedata/SUPPORTED file in the glibc source (but see X11 notes below).
LANG=nb_NO (or, equivalently, nb_NO.ISO-8859-1), other variables unset.
Here's how to verify this:
# export LANG=nb_NO
# locale charmap
ISO-8859-1
# locale language
Norwegian, Bokmål
# locale territory
Norway
# locale int_select
00
# locale int_prefix
47
# locale int_curr_symbol
NOK
# locale currency_symbol
kr
# date
lør jul 30 18:32:00 YEKST 2005
So the basic glibc-related stuff looks right. The caveat is getting X11
right because of the recent no_NO -> nb_NO transition. The locale must
be mentioned in the left column in /usr/X11R6/lib/locale/locale.alias.
In fact, with Xorg 6.8.2, both nb_NO and nb_NO.ISO-8859-1 are listed
there, so there should not be any problem.
--
Alexander E. Patrakov
--
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page