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

Re: non-ASCII characters in /etc/locales.alias ?

On Wed, Jan 23, 2002 at 09:53:04AM +0000, Alastair McKinstry wrote:
> The user should not be messing about with locale aliases. In this sense,
> I agree with Ulrich; it should just "go away". It is there for

Should, but probably won't, so it can't be simply ignored.

> Ulrich is also right that they are "byte sequences", and as their

Not really relevant.  All files are byte sequences, so this is true by
default.  Textfiles are *constrained* byte sequences, and this breaks
the constraints normally imposed on system textfiles.

> However the file is confusing, and misleads the user into thinking
> "fran?ais" (if that is how it is shown in the "wrong" locale), is a
> valid locale name, or "bokml"; they may type in those as locale names,
> and things break. Also, if they do "locale -a" they will be shown these
> "locales", which are invalid, and hence not really available.

And "locale -a" should never be outputting anything that's not in the
user's charset, nor should any system tool that should know better.

> This is why I brought the subject up in the context of locale-gen: I
> believe the whole locales.alias file should be autogenerated by
> locale-gen. Because not only is "fran?ais" an invalid locale, if I
> haven't got the locale files on my system generated by locale-gen, then
> "LANG=german" is also invalid, and should not be shown as a valid entry
> in /etc/locales.alias or "locale -a". These should show "all available
> locales", as described in the man page (on Linux, and similarly on
> Solaris, etc. looking around here..)

I agree.  "locale -a" is documented as: "Write names of available
locales."  It displays names of *unavailable* locale aliases, so either
it's a bug or it's misdocumented.

This could be fixed with a patch to locale rather than playing around
with the aliases file, however.

Is there any need for locale -a to display aliases at all?  They're not
really locales, they're just aliases *to* locales.

> I Think this should generate these entries. It should also include the
> "français" and "bokmål" entries, as they may be needed (when French and
> Norwegian locales are generated), but probably issue warnings that they
> are for backward compatability and should not be used. The locale.alias

Er, then issue warnings whenever any French or Norwegian locales are
generated?  That's no good.  Perhaps --compat with a warning in the docs
and --help.

> Hence the "-*- coding: ISO-8859-1 -*-" tag I suggested for locale.alias.
> Yes, its emacs specific, but it gets the point across and at least makes
> one editor work right. Its a workaround to a misfeature; the

It implies the invalid sequences are valid, may encourage this in other
files, implies changing this line somehow changes how the file is
interpreted by programs (ie. that "locale -a" uses it).  If anything
should be added, it's something to the effect of "warning: this file contains
ISO-8859-1 characters which should not be here; do not do this anywhere else."

Glenn Maynard

Reply to: