On Mon, Nov 02, 2009 at 05:34:50PM +0100, Vladimir Marek wrote: > Linux uses locale.alias (Debian has /etc/locale.alias and > /usr/X11R6/lib/X11/locale/locale.alias for example). To aid Linux users, > it might be good idea to create locale.alias(4) man page. > > > > The mapping tables shown at locale_alias(5) [2] are formulated from the > > data extracted from [3], [4], and some operating systems such as AIX 6.1, > > HP-UX 11.11, RHEL 5.4, Ubuntu 9.04, and the latest OpenSolaris/Solaris > > Nevada > > via some simple reverse engineering. They will be embedded into libc under > > read only data section. (We expect there will be no significant changes at > > the tables, if any, in the future.) > > Oh, this is not file, but rather ELF section? I don't see the aid for > the user if he has to file escalation (pay support first) and wait some > time to get updated packages from upstream, just to make his cs_CZ.UtF-8 > work?
If Linux makes locale aliases configurable, then we should consider doing the same. Locale names/aliases are best not picked by users, not randomly anyways, but given the history here, I think letting users configure locale aliases is fine. We should also consider hardcoding common alias canonicalization algorightms such as "fold up the case of the codeset name component of the locale". It's fine, IMO, to "compile" a locale alias DB so that a quick index operation can be used (whether an ELF symbol table, a directory, or a sorted list of fixed-sized entries). Making the user run some command to update the locale alias DB seems fine. > > Although this project does not change locale(1) utility, this project also > > update the NOTES section of locale(1) man page as shown at [2] to clarify on > > the "locale -a" output that locale aliases are supported only as aliases and > > will not be shown at the output. > > Just out of interest, what is the difference between canonical locale > name, and 'additional locale name'? Why do we have to keep them > separated? We would not need lawyer-like documentation like > http://sac.sfbay/PSARC/2009/594/materials/setlocale.3c.diff If aliases are configured, then locale(1) should have an option to list them. If aliases are algorithmically determined then there may not be a way to list them all, but a locale(1) option to determine whether a given locale name is valid and what its canonical form is, would be nice. Presumably running "LC_ALL=<alias> locale" would show the canonicalized locale names in its output. Nico --