develooper Front page | perl.perl5.porters | Postings from March 2001

Re: [ID 20010225.003] inconsistencies in locale support

Thread Previous | Thread Next
From:
andrew
Date:
March 2, 2001 07:16
Subject:
Re: [ID 20010225.003] inconsistencies in locale support
Message ID:
20010302101506.N17705@pimlott.ne.mediaone.net
On Mon, Feb 26, 2001 at 07:13:48PM -0500, Andrew Pimlott wrote:
> On Mon, Feb 26, 2001 at 11:44:27PM +0000, Simon Cozens wrote:
> > On Mon, Feb 26, 2001 at 06:31:50PM -0500, Andrew Pimlott wrote:
> > > The reason is that isalpha is implemented as .xs code, while tolower
> > > is a pure Perl subroutine that calls lc. 
> > 
> > Urgh, that's a bug. tolower in POSIX should call the underlying C routine.
> > POSIX.pm things should be POSIXish first and Perlish second.
> 
> As for which ones need to be in C for locale purposes, aside from
> tolower and toupper, the only candidate I see (that is actually
> implemented) is strerror.

FWIW, I took a quick look at this but gave up.  For toupper and
tolower, I thought I could just make them aliases to CORE::uc and
CORE::lc, but I discovered you can't do that in Perl, and I'm not up
to figuring out the XS method.  For strerror, I discovered that it
already "works", but only because locale is not properly lexically
scoped.  That is, there are many places where perl must call
locale-aware C functions (like strerror()), but perl doesn't turn on
and off C locale support (with setlocale()) by locale scope.  (I
infer from this that nobody's interested in getting locale support
100% right anyway.)

Andrew

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