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

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

Thread Next
Eric Brine
May 27, 2013 04:00
Re: [perl #63402] use open :locale doesn't work in Windows
Message ID:
On Sun, May 26, 2013 at 1:40 PM, bulk88 via RT <>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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About