perladvent / perldotcom

The source code for Perl.com website
https://www.perl.com
77 stars 80 forks source link

binmode and UTF-8 #283

Closed taniwallach closed 3 years ago

taniwallach commented 3 years ago

In https://www.perl.com/pub/2012/04/perlunicook-decode-standard-filehandles-as-utf-8.html/ I think you may want to use

binmode(STDOUT, ":encoding(UTF-8)");

instead of

binmode(STDOUT, ":utf8");

as Perl 5.30 is making it fatal to sysread and syswrite on :utf8 filehandles (it was deprecated in 5.24), which apparently can occur when binmode is set to :utf8.

Same for the similar lines for STDIN and STDERR.

See: https://perldoc.perl.org/perl5300delta#Previously-deprecated-sysread()/syswrite()-on-:utf8-handles-is-now-fatal

briandfoy commented 3 years ago

This is updated in 9d2992ed and will be part of the next refresh. Thanks!

taniwallach commented 3 years ago

Thanks for the fast handling and making the update.