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

Bug#284137: locale -a reports misleading values for UTF-8 locales



At Fri, 3 Dec 2004 23:55:21 +0100,
Guillermo S. Romero <gsromero@alumnos.euitt.upm.es> wrote:
> When I run locale -a, I get results like en_GB.utf8 or es_ES.utf8.
> OTOH, dpkg-reconfigure locales uses en_GB.UTF-8 or es_ES.UTF-8, which
> are the values also listed in /usr/share/i18n/SUPPORTED. It would be
> nice if locale -a reported the more correct values with UTF-8 not
> utf8, it can lead to use the wrong value.

Glibc uses "canonical locale name" with lower-case, hyphen-removed in
its internal.  So, "UTF-8" is just alias for utf8.  "UTF-8" is
requested by LSB specification, but it may be changed in future.  So
using canonical name is the right way.

Technically we can have "requested locale name" like "UTF-8" in
/usr/lib/locale/locale-archive.  But it cannot be applied to the
directory style (/usr/lib/locale/en_GB.utf8).  I think we should not
record the raw "UTF-8" into /usr/lib/locale/ dir name because we need
to issue unnecessary stat(2) to check both canonical name "utf8" and
user requested name "UTF-8" everytime.  

So the question falls back to "it's worthwhile to record user
requested locale name into locale-archive file".  I think it's
overkill to support "user requested name UTF-8".  Moreover, if an
application needs to check locale availability, such application
everytime needs to parse both canonical name and user requested
(non-canonical name).  So I think this wishlist is not acceptable.

If you have objection from the technical point of view, please let us
know.  Otherwise, I would like to close this report to avoid
increasing a lot of glibc wishlist.

Regards,
-- gotom






Reply to: