develooper Front page | perl.perl5.porters | Postings from June 2013

Re: [perl #38193] embedded perl always calls setlocale(LC_ALL,"")

Thread Previous | Thread Next
From:
Karl Williamson
Date:
June 24, 2013 20:06
Subject:
Re: [perl #38193] embedded perl always calls setlocale(LC_ALL,"")
Message ID:
51C8A6A9.7010404@khwilliamson.com
On 02/03/2013 08:13 AM, Andrew Dunstan wrote:
>
> On 02/02/2013 11:47 AM, Karl Williamson wrote:
>> On 02/01/2013 12:03 PM, Andrew Dunstan wrote:
>>>
>>> On 02/01/2013 01:45 PM, Karl Williamson via RT wrote:
>>>> Could this be a Configure option, or an environment variable option?
>>>>
>>>
>>> I'm not sure why are you asking me.
>>>
>>> cheers
>>>
>>> andrew
>>>
>>
>> Someone with your email address filed a bug report
>> https://rt.perl.org/rt3/Ticket/Display.html?id=38193
>> against the Perl programming language 7 years ago.  The report has sat
>> unresponded to until I looked at it and sent the email you got.
>>
>> If it was you who filed the original ticket, is this a problem that
>> you still think should be addressed? even if you've found a work
>> around, or abandoned Perl, etc.
>>
>> An easy implementation that occurred to me was to have an environment
>> variable, say PERL_LOCALE_ALREADY_SET, which if defined would tell
>> Perl not to do a setlocale(LC_ALL,"").  I hope that that would meet
>> the original requester's concern.
>>
>> If you are not the original requestor, please let us know so that we
>> can remove your email address from this bug report;  if you have an
>> opinion on this, please respond with it.
>>
>> Perl is an essentially all volunteer organization, and apparently no
>> one with enough time and appropriate skill set looked at this bug in
>> all the intervening years.  I'm sorry about that.
>>
>> I think that something like this fix has merit, even if the original
>> requester is long gone.
>>
>
> No, it was probably me. 7 years is a long time :-) I'm glad the Perl
> community is cleaning up the old bugs. PERL_LOCALE_ALREADY_SET would
> work. But if we're to use it we need to know if the feature is
> supported, and that test needs to be available before we call
> perl_alloc() - I'm not sure how easy that would be to do - maybe a
> static test would do. See
> <https://github.com/postgres/postgres/blob/master/src/pl/plperl/plperl.c> at
> about line 695 for an example of the current PostgreSQL workaround.
>

I am actually starting work on this now, and am gathering more 
information.  The windows setlocale documentation 
http://msdn.microsoft.com/en-us/library/hzz3tw78

says "If locale points to an empty string, the locale is the 
implementation-defined native environment."

I presume the problem is that you have set things up to override the 
native environment of the implementation, and Perl is screwing that up. 
  If so, it would seem that the issue isn't just LC_ALL, but all the 
categories that Perl calls setlocal(foo, "") on.  If it is just the 
LC_ALL call, please give me more detail about your situation.


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