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

Re: [perl #63402] use open :locale doesn't work in Windows

Thread Previous | Thread Next
From:
Eric Brine
Date:
May 28, 2013 01:38
Subject:
Re: [perl #63402] use open :locale doesn't work in Windows
Message ID:
CALJW-qE5B_-8KNaDGUHi364kt9iOD1YBjySLZPhun2uY_K0x-A@mail.gmail.com
On Sun, May 26, 2013 at 11:59 PM, Eric Brine <ikegami@adaelis.com> wrote:

> On Sun, May 26, 2013 at 1:40 PM, bulk88 via RT <perlbug-followup@perl.org>wrote:
>
>> No change in behavior the reporter observed on 5.19.0. I can't comment
>> whether there is a bug here or not.
>>
>
> Well, I don't think having the following lead every portable script is a
> proper expectation of Perl programmers:
>
>     my $encoding;
>     BEGIN {
>        if ($^O eq 'MSWin32') {
>           require Win32;
>           my $cp = Win32::GetConsoleCP();
>           $encoding = ":encoding(cp$cp)";
>        } else {
>           $encoding = ':locale';
>        }
>     }
>
>     use open ':std', $encoding;
>
> The solution may not be to change :locale.
>

In fact, the solution can be implemented in a module. Given this and given
the fact that it's very unlikely that this ticket will motivate anyone to
work on this problem, so you can close this ticket if you want.

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