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

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

Thread Previous | Thread Next
Paul "LeoNerd" Evans
August 6, 2021 18:23
Re: "use v5.36.0" should imply ASCII source
Message ID:
On Fri, 6 Aug 2021 20:03:48 +0200
Graham Knop <> 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?

Paul "LeoNerd" Evans      |  |

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