-
Notifications
You must be signed in to change notification settings - Fork 601
Closed
Description
RFC 7 is the "source encoding pragma", meant to allow the programmer to declare the encoding of the source document. Right now, we have two options for this:
use utf8which says "this source document is UTF-8 encoded, decode it before compiling"- not using
use utf8which says "this source document is bytes"
Both of these options lead to confusion of one sort or another, and I am not here (today, anyway) to argue which is absolutely better. But what is lacking is:
use asciito say "if it's not ASCII, which is unambiguous in meaning, reject compilation"
The new pragma is meant to be a one-stop-shop for declaring any of the above, to be called as:
use source::encoding 'ascii'use source::encoding 'utf8'no source::encoding(but this one is probably better avoided)
I proposed that the utf8 form do the same thing as utf8, and that over time we tighten up the strictness of utf8.pm, and then also of the exact codepoint sequences permitted in Perl source -- but those enhancements can happen later than and separately from this pragma.
Metadata
Metadata
Assignees
Labels
No labels