develooper Front page | perl.perl5.porters | Postings from February 2022

Re: Deprecating downgrade of `use utf8`

Thread Previous | Thread Next
From:
Dan Book
Date:
February 21, 2022 18:43
Subject:
Re: Deprecating downgrade of `use utf8`
Message ID:
CABMkAVWyc7KUYBFZX5aZxcUYJe+gC+EE69jyjtPC_gtpjxrvxQ@mail.gmail.com
On Mon, Feb 21, 2022 at 1:22 PM G.W. Haywood via perl5-porters <
perl5-porters@perl.org> wrote:

> Hi there,
>
> On Mon, 21 Feb 2022, Paul "LeoNerd" Evans wrote:
>
> > On a similar note: How do people feel about code which turns off the
> > "my source encoding is UTF-8" pragma after having previously turned it
> > on? I.e.
> >
> >  use utf8;
> >  my $café = "Ĉu vi havas sandviĉojn?";
> >
> >  no utf8;
> >
> > If we disallow this kind of thing, we can remove further weird
> > cornercases from the parser, because a bunch of unlikely situations no
> > longer come up.
> >
> > As with VERSION: Are there any actually-valid use-cases for doing this
> > kind of thing?
>
> I think there might be, and it makes me wonder about things like
>
> use open qw/ :encoding(UTF-8) :std /;
>
> and
>
> open( my $fh, "<:encoding(UTF-8)", $filename ) or die ...
>
> and if, and if so how, they might be affected.


These operations are completely unrelated. "use utf8" only affects parsing
of the source code.

-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