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

Re: Perl 5.20.0 Blockers, 2014-03-24

Thread Previous | Thread Next
From:
Zefram
Date:
March 24, 2014 16:08
Subject:
Re: Perl 5.20.0 Blockers, 2014-03-24
Message ID:
20140324160809.GX18071@fysh.org
Ricardo Signes wrote:
>3.  "Make perlbug Unicode-aware" broke perlbug on Win32
>    https://rt.perl.org/Ticket/Display.html?id=121277

I think there's a bug in the Unicode-awareness patch.  $input_encoding is
set by

	my $input_encoding = $::Have_get_locale_encoding ? encoding::_get_locale_encoding() : '';

and then used as

	open(F, "<:$input_encoding", $file)

$input_encoding will get values such as "UTF-8" and "ANSI_X3.4-1968"
which are not valid layer names.  It should instead be initialised as

	my $input_encoding = $::Have_get_locale_encoding ?
		"encoding(@{[encoding::_get_locale_encoding()]})" : '';

As for the CRLF issue, perlbug should probably detect whether :crlf is
a default layer and handle it appropriately.  Something like

	use PerlIO ();
	my $crlf = (grep { $_ eq "crlf" } PerlIO::get_layers(STDOUT)) ?
		":crlf" : "";
	...
	open(REP, ">:raw $crlf", $filename)
	...
	open(REP, "<:raw $crlf", $filename)

(The opening for input occurs in four places.)

-zefram

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