Red Hat Bugzilla – Bug 177244
"locale -a" gives misleading information
Last modified: 2007-11-30 17:11:20 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (compatible; MSIE 6.0; Windows; U; AIIEEEE!; Win98; Windows 98; en-US; Gecko masquerading as IE; should it matter?; rv:1.8b) Gecko/20050217
Description of problem:
If you type "locale -a" it shows locales with charsets such as "utf8".
But there is no charset "utf8". There is a "UTF-8" one though.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.type "locale -a"
Actual Results: C
Expected Results: C
Just listing directories in /usr/lib/locale is not the right way to enumerate locales. The directories are named with different shceme to actual character set and used in LC_* environment variables.
That's not misleading info, charset names are canonicalized and e.g. .UTF-8
is equivalent to .utf8, to .UTF8, .utf-8, .UTF______________8 etc.
Where is that documented?
Wouldn't it be proper for the user to only deal with offical names (eg UTF-8)
and not various mangled/canocialized names?
Why does it need to be documented? The locale names are an implementation detail
according to POSIX, and no matter whether you use say en_US.utf8 or en_US.UTF-8
it will work the same.
If you do "locale -m" there is no "utf8".
Yet if you do "locale -a" you get a whole bunch of character sets that according
to to "locale -m" do not exist.
It would be nice if "locale -m" and "locale -a" were complete and consistent.