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

Re: Perl 5.20.0 Blockers, 2014-03-24

Thread Previous | Thread Next
March 24, 2014 16:08
Re: Perl 5.20.0 Blockers, 2014-03-24
Message ID:
Ricardo Signes wrote:
>3.  "Make perlbug Unicode-aware" broke perlbug on Win32

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.)


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About