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

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

Thread Previous | Thread Next
Dan Book
July 30, 2021 18:40
Re: "use v5.36.0" should imply UTF-8 encoded source
Message ID:
On Fri, Jul 30, 2021 at 2:34 PM Andrew Hewus Fresh <>

> On Fri, Jul 30, 2021 at 10:45:53AM -0400, Ricardo Signes wrote:
> > Porters,
> >
> > I propose that "use v5.36.0" should imply that the source code is,
> subsequently, UTF-8 encoded.
> >
> > Currently, I advise the following boilerplate:
> > use v5.34.0;
> > use warnings;
> > use utf8;
> Tom recommends a bit more boilerplate than that, although the only
> one (other than fatal warnings) that hasn't been mentioned is:
> use open qw(:std :encoding(UTF-8)); # undeclared streams in UTF-8
> And wow would I like to get rid of the "wide character in output" from
> my `perl -E` one-liners (I know, `perl -C -E`, but boilerplate!).

This is not feasible because it affects STDIN/STDOUT/STDERR globally and so
will break the assumptions of any code in the process that uses them.
Lexically setting defaults for only handles only opened in that scope may
be feasible for use VERSION (the equivalent of the same declaration without
:std), but since such filehandles can still be passed around that is also
something that would need a "risk assessment".


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