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

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

Thread Previous | Thread Next
From:
Dan Book
Date:
August 6, 2021 18:58
Subject:
Re: "use v5.36.0" should imply ASCII source
Message ID:
CABMkAVWZXwOLRuA1EDKgssbePswgw8rYXT8mCGHUfXBwEsHwjw@mail.gmail.com
On Fri, Aug 6, 2021 at 2:23 PM Paul "LeoNerd" Evans <leonerd@leonerd.org.uk>
wrote:

> On Fri, 6 Aug 2021 20:03:48 +0200
> Graham Knop <haarg@haarg.org> wrote:
>
> > Pod is often interleaved with code, and more likely to include names,
> > and thus, UTF-8 characters. The way to declare Pod content as UTF-8 is
> > separate from how it is declared for the source. Should users be
> > required to include both a 'use utf8;' and '=encoding UTF-8' if they
> > want to include UTF-8 characters in their documentation, even if their
> > code is pure ASCII?
>
> We discussed this very question. The trouble is it's a quickly-slippery
> slope. If you allow non-ASCII in POD, do you allow it in comments? The
> same justification - it's common to write people's (non-English) names
> in comments just as well as POD. Should it be allowed there?
>
> This quickly leads to another weird entry in a future "Perl Quirks"
> document 10 years down the line, where users complain that the rules of
> non-ASCII are hard to guess and subtle and anyway PPR doesn't do it
> right and also there are bugs in the parser and ...
>
> It's far easier for everyone - implementation and users alike - to give
> a very simple rule:
>
>   After `use VERSION>=5.36` and until any `use utf8` there must be no
>   non-ASCII bytes whatsoever.
>
> Yes this does lead to an annoying dual declaration of both `use utf8`
> and `=encoding UTF-8` - perhaps that can be helped in some way?
>

I don't think it's comparable. Comments are parsed by the perl interpreter,
but POD is not, except to find the end of the POD.

-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