develooper Front page | perl.perl5.porters | Postings from November 2014

Re: new locale warnings (Re: [perl.git] branch blead, updated. v5.21.5-435-gbd083ee)

From:
Karl Williamson
Date:
November 19, 2014 04:47
Subject:
Re: new locale warnings (Re: [perl.git] branch blead, updated. v5.21.5-435-gbd083ee)
Message ID:
546C20DA.1090608@khwilliamson.com
On 11/18/2014 09:01 PM, Craig A. Berry wrote:
>
>> On Nov 17, 2014, at 10:59 AM, Craig A. Berry <craig.a.berry@gmail.com> wrote:
>>
>> On Sun, Nov 16, 2014 at 11:27 PM, Karl Williamson
>> <public@khwilliamson.com> wrote:
>>
>>> This is strange.  Try this one liner and see if you get the warning.
>>>
>>> perl -Ilib -MPOSIX -le 'use locale; print setlocale(LC_ALL, "C")'
>>>
>>> I can't fathom how you wouldn't get it, based on the output you sent below,
>>> But I can't fathom how it's not showing up in the test suite either, as I
>>> think the C locale is used in many places, nor can I see why MS would be
>>> doing this.  It would mean another violation of the POSIX standard, and in a
>>> recent version of their software to boot.  T think dromedary is using VS
>>> 2010.
>>
>> The C locale doesn't warn but when other locales do warn they
>> sometimes say that the problem is with the C locale rather than the
>> one actually being used.  It's like there's something sticky about the
>> first warning that causes every subsequent warning to complain about
>> 'C':
>>
>> .\perl -Ilib -MPOSIX -le "use locale; for $l (@ARGV) {print
>> setlocale(LC_ALL, $l);}" C Japanese_Japan.932 zh ja ko C
>> C
>> Locale 'Japanese_Japan.932' may not work well.  Some characters in it
>> are not recognized by Perl.
>> Japanese_Japan.932
>> Locale 'C' may not work well.  Some characters in it are not recognized by Perl.
>> zh
>> Locale 'C' may not work well.  Some characters in it are not recognized by Perl.
>> ja
>> Locale 'C' may not work well.  Some characters in it are not recognized by Perl.
>> ko
>> C
>
>
> Same thing happens on OS X, where the warning is simply reporting the wrong locale:
>
> $ ./perl -I../lib -MPOSIX -le 'use locale; for $l (@ARGV) {print setlocale(LC_ALL, $l);}' C zh_CN.GBK zh_TW.Big5 C
> C
> Locale 'C' may not work well.  Some characters in it are not recognized by Perl.
> zh_CN.GBK
> Locale 'C' may not work well.  Some characters in it are not recognized by Perl.
> zh_TW.Big5
> C
>

That gave me an idea, so I have a suspicion as to what is going on.  I'm 
hoping you will try the attached patch, and that it fixes the issue.




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