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

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

Thread Next
From:
Eric Brine
Date:
May 27, 2013 04:00
Subject:
Re: [perl #63402] use open :locale doesn't work in Windows
Message ID:
CALJW-qEhb3p=r36nTPicognb6tM2iJJ86o7LMz_ouSj22nHMLA@mail.gmail.com
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.

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