Bug 177244

Summary: "locale -a" gives misleading information
Product: [Fedora] Fedora Reporter: JW <ohtmvyyn>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-01-08 14:47:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description JW 2006-01-08 05:53:40 UTC
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):
glibc-2.3.5-10.3

How reproducible:
Always

Steps to Reproduce:
1.type "locale -a"
2.
3.
  

Actual Results:  C
POSIX
aa_DJ
aa_DJ.iso88591
aa_DJ.utf8
aa_ER
aa_ER.utf8
....



Expected Results:  C
POSIX
aa_DJ
aa_DJ.ISO-8859-1
aa_DJ.UTF-8
aa_ER
aa_ER.UTF-8
...


Additional info:

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.

Comment 1 Jakub Jelinek 2006-01-08 06:02:00 UTC
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.


Comment 2 JW 2006-01-08 06:05:01 UTC
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?



Comment 3 Jakub Jelinek 2006-01-08 14:47:45 UTC
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.

Comment 4 JW 2006-01-08 22:35:13 UTC
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.