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

Re: Bug#55913: liblocale-gettext-perl: setlocale(LC_ALL, "de") doesn't work but $ENV{'LC_ALL'} = "de" does



On Sun, Jan 23, 2000 at 12:35:25AM +0100, Raphael Hertzog wrote:
> reassign 55913 perl-5.005
> thanks
> 
> Le Sat, Jan 22, 2000 at 06:18:53PM +0100, mito@aparima.com écrivait:
> > Package: liblocale-gettext-perl
> > Version: 1.01-8
> > Severity: normal
> > 
> > % perl -MLocale::gettext -MPOSIX -le '$ENV{LC_ALL}="fr"; textdomain("libc"); print gettext("Interrupt");'
> > produces:
> > Interruption
> > 
> > % perl -MLocale::gettext -MPOSIX -le 'setlocale(LC_ALL, "fr") ; textdomain("libc"); print gettext("Interrupt");'
> > produces:
> > Interrupt
> > 
> > It seems the setlocale() call does nothing, or am I missing something?
 
Hello,

I'm not quite sure this isn't normal ( I mean for setlocale()). The POSIX 
specification tells that you must use ll_UU (example fr_FR) to set the locale. 
So the call: `setlocale(LC_ALL,"fr")' fails and the default is set to "C".
The call `setlocal(LC_ALL,"fr_FR")' will succeed.

So, it seems that PERL is more "cool" about the specification because Perl
accepts $ENV{LC_ALL}="fr" (or because the first Perl call tries to set
LC_ALL with this value and fails; then tries LANG and fails ; and then tries
LANGUAGE with this value and succeeds, but, AKAIK, LANGUAGE isn't POSIX).

Cheers,
-- 
Thierry LARONDE
thierry.laronde@polynum.com
website : http://www.polynum.com


Reply to: