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
From:
Dan Book
Date:
August 4, 2021 23:34
Subject:
Re: "use v5.36.0" should imply UTF-8 encoded source
Message ID:
CABMkAVWVOqAA6qBs+wPyCaO1XEqtBxQ+ePvhUOxqU+OG5v5sjg@mail.gmail.com
On Wed, Aug 4, 2021 at 6:59 PM Aaron Priven <aaron@priven.com> 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.

-Dan

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