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

Re: "use v5.36.0" should imply ASCII source

Thread Previous | Thread Next
August 6, 2021 16:53
Re: "use v5.36.0" should imply ASCII source
Message ID:
"Ricardo Signes" <> wrote:
>At the PSC, we had a long talk about this, and another proposal was made:
>We introduce a new stricture, which I'll call "source_encoding".  Under
>"use strict 'source_encoding'", the compiler will raise an exception when
>the source contains non-ASCII content unless the utf8 pragma is in effect. 
>The error raised can drive the programmer to documentation explaining
>the various trade-offs.  That is: you can turn on utf8 and deal with how
>this affects your I/O, or you can disable the stricture, or you can
>restate your non-ASCII content as ASCII by using escaping constructs.
>I'm not *sure* this is an improvement, but I think it is.  This prevents
>the "I forgot to add utf8 and so only discovered after runtime that
>I have doubly-encoded my output" bug.

+1 - for me that's a big improvement over "turn utf8 on automatically":
the latter would have been a reason for me to avoid "use <version>", while
this would be a reason to use it.


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