Re: non-ASCII characters in /etc/locales.alias ?
On Wed, 2002-01-23 at 11:28, Glenn Maynard wrote:
> (Er, your quoting is a bit confusing; it looks like you're replying to
> yourself in places. Parsing and moving stuff around ...)
> On Wed, Jan 23, 2002 at 10:53:04AM +0000, Alastair McKinstry wrote:
> > > 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.
> > 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.
> But in a text file, they need to follow text file rules. If they can't
> be represented in the proper locale, they need to be represented in some
> other way (ie. escapes.)
> I'm not sure introducing escapes into locale.aliases would be a good
> idea, though. That would mean adding code to help something that
> shouldn't be there in the first place. I'd just as soon leave the
> problem in place, with appropriate warnings in comments in the file.
Agreed. IMHO there is no real solution to this; thats why it was such a
bad idea to introduce ISO-8859-1 aliases in the first place.
> > > 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.
> > 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".
> With the problems I mentioned; I think the problems outweigh the gain.
> I'd hate to see "let's do what they did with locale.alias and stick an
> Emacs tag in these files, too!"
Valid point; I don't want to set a precendent: system files should be
readable in all locales
The tag wouldn't fix locale -a's output
> on my UTF-8 terminal, either.
> "locale -a" outputting ISO-8859-1 text regardless of the user's locale
> a bigger problem than /etc/locale.alias having them. (Whether or not
> anyone ever touches or looks at /etc/locale.alias, people do, will and
> are intended to look at locale -a's output.)
Yes. I should have included that bit (from an earlier proposal): locale
would not display any locale alias that was not valid in the current
> > > 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.
> OK, but this could still be done in locale itself: don't output a locale
> alias if the underlying locale isn't actually available.
If we have locales.alias generated from the locales by locale-gen, then
correct 'locale -a' drops out automatically; it also works if the user
edits the locales.alias file. If we have 'locale' censor the list, it
has to parse the locales directory, and presents a list that is
inconsistent with the locales.alias file.
> Glenn Maynard
Alastair McKinstry, <email@example.com>