develooper Front page | perl.perl5.porters | Postings from August 2021

Re: "use v5.36.0" should imply UTF-8 encoded source

Thread Previous | Thread Next
Dan Book
August 4, 2021 23:34
Re: "use v5.36.0" should imply UTF-8 encoded source
Message ID:
On Wed, Aug 4, 2021 at 6:59 PM Aaron Priven <> wrote:

> On August 3, 2021 13:26, Felipe Gasper wrote:
> > It sounds like you want STDIN/STDOUT/STDERR and @ARGV to be decoded by
> default, in addition to the source code. TBH that makes more sense to me
> than the present proposal since it would preserve parity of character
> encoding for simple programs, though I think it would still sow confusion
> since other filehandles will remain binary by default:
> Are other filehandles binary by default? I thought they were text by
> default, with the “:crlf" layer applied on those operating systems where it
> is appropriate. Perhaps in 2021 “text by default” should include encoding.

They are "text by default" in the ASCII sense, not the Unicode sense. The
:crlf layer is enabled by default on Windows and translates CR LF to LF,
but there is no default translation of bytes to characters. So you need to
use binmode or :raw to make a filehandle binary-compatible on Windows, but
you also need to apply an :encoding layer if you want to read/write
characters instead of bytes.


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