develooper Front page | perl.perl5.porters | Postings from January 2012

[perl #5907] inconsistencies in locale support

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
January 30, 2012 18:35
Subject:
[perl #5907] inconsistencies in locale support
Message ID:
rt-3.6.HEAD-14510-1327977297-1609.5907-15-0@perl.org
On Fri Mar 02 10:29:21 2001, RT_System wrote:
> On Fri, Mar 02, 2001 at 09:21:41AM -0600, Jarkko Hietaniemi wrote:
> > If you can
> > point out some of the spots where setlocale() acrobatics would be
> > needed, I can take a look them.
> 
> Hmm, looks like I missed an essential point:  locale support is not
> dependent on 'use locale' at all!  This seems to be intentional.
> perl unconditionally calls setlocale() on startup, and never calls
> it again (unless you use POSIX::setlocale() explictly).  So
> POSIX::isalpha() respects $LANG by default, even if you never
> mention the locale pragma.
> 
> It is only where (core) perl has a choice between calling a
> locale-sensitive libc function, and doing things its own way (eg,
> hard-coding character semantics), that the locale pragma currently
> matters.  Since the string value of $! requires calling a
> locale-sensitive function (strerror()), $! always respects locale.
> 
> perllocale is not at all clear on this; I expected that without "use
> locale", the locale system would never be initialized.  However, the
> locale.pm doc says what seems to be the intent:
> 
>     This pragma tells the compiler to enable (or disable) the use of
>     POSIX locales for built-in operations
> 
> Should we take that as the law of the land?  In that case, the only
> bug I know about is $! .  (Possibly also $^E .)  setlocale()
> acrobatics are the obvious solution.  I will poke around for more if
> the above rule is agreed upon.
> 
> Andrew
> 

There has been no movement on this ticket for nearly eleven years.

Does anyone feel we are in need of the "setlocale acrobatics" discussed
in this ticket?  If so, then we should probably outline those in a new
RT.  If not, we should close the ticket.

Thank you very much.
Jim Keenan


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=5907

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About