This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/11635] New: setlocale() doesn't support path based locale specification
- From: "yann at droneaud dot fr" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 25 May 2010 14:56:23 -0000
- Subject: [Bug libc/11635] New: setlocale() doesn't support path based locale specification
- Reply-to: sourceware-bugzilla at sourceware dot org
I've created a locale definition with localedef -f UTF-8 -i fr_FR
$PWD/fr_FR.UTF-8 which create a private definition.
According to The Open Group Base Specifications Issue 7 / IEEE Std 1003.1-2008:
If the name contains one or more <slash> characters, name shall be interpreted
as a pathname where the created locale definitions shall be stored.
The path can latter be used as LC_* environment variables values:
The value that is used to specify a locale when using environment variables
shall be the string specified as the name operand to the localedef utility
when the locale was created.
[...]
When the value of a locale environment variable begins with a <slash> ( '/' ),
it shall be interpreted as the pathname of the locale definition; the type of
file (regular, directory, and so on) used to store the locale definition is
implementation-defined.
Example: LC_ALL=$PWD/fr_FR.UTF-8 locale
But this doesn't work under GLIBC.
According to strace: setlocale() implementation first look to "locale-archive",
then search the LC_ALL value in a directory lookup, e.g. the system directory,
defined at build time. See the following log:
open("/opt/glibc-devel/lib/locale//home/ydroneaud/tmp/fr_FR.UTF-8//LC_CTYPE",
O_RDONLY) = -1 ENOENT (No such file or directory)
open("/opt/glibc-devel/lib/locale//home/ydroneaud/tmp/fr_FR.utf8/LC_CTYPE",
O_RDONLY) = -1 ENOENT (No such file or directory)
open("/opt/glibc-devel/lib/locale//home/ydroneaud/tmp/fr_FR/LC_CTYPE", O_RDONLY)
= -1 ENOENT (No such file or directory)
open("/opt/glibc-devel/lib/locale//home/ydroneaud/tmp/fr.UTF-8//LC_CTYPE",
O_RDONLY) = -1 ENOENT (No such file or directory)
open("/opt/glibc-devel/lib/locale//home/ydroneaud/tmp/fr.utf8/LC_CTYPE",
O_RDONLY) = -1 ENOENT (No such file or directory)
open("/opt/glibc-devel/lib/locale//home/ydroneaud/tmp/fr/LC_CTYPE", O_RDONLY) =
-1 ENOENT (No such file or directory)
Where /opt/glibc-devel/lib/locale is the system locale directory and
/home/tmp/ydroneaud/tmp/fr_FR.UTF-8 the path given as LC_ALL.
--
Summary: setlocale() doesn't support path based locale
specification
Product: glibc
Version: 2.12
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: drepper at redhat dot com
ReportedBy: yann at droneaud dot fr
CC: glibc-bugs at sources dot redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=11635
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.