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

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

On Wed, 2002-01-23 at 10:26, Glenn Maynard wrote:
> 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
I think in context the _locale_aliases_ are  byte sequences; they don't
need to be valid characters in any given locale to work; having them
undisplayable in various locales is a misfeature, IMHO.

> 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.
The difficulty is that /etc/locales.alias is a valid text file
_in_certain_locales_ , but not others; this is a bad idea, especially in
system files. Tagging it with a coding at least says that "This is a
valid textfile in encoding ISO-8859-1 and can be edited as such".
> 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.
Compatability with other systems; e.g. Solaris shows the aliases.
Also, for the few cases (eg "LANG=french evolution") that the user is
manually selecting a locale name, showing some simple entries like
"french" rather than just the formal locale names helps the user decide
what to use.
> > 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.
True. "warning" is too strong: "information" might be a better
term/level. I think  "--verbose" might be better:
"Entries for "bokmal and francais have been generated. These are for
compatability only and should not be used" , or some better wording.
> > 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."
Maybe. I thought this would be covered by the "Warning: this file is
autogenerated; don't add new entries" comment, though. 
> -- 
> Glenn Maynard

Alastair McKinstry,<mckinstry@computer.org>

Reply to: