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

Re: RFC: Rename the “UTF8” flag

Thread Previous | Thread Next
David Cantrell
January 29, 2022 00:24
Re: RFC: Rename the “UTF8” flag
Message ID:

On 28/01/2022 15:26, Felipe Gasper wrote:

 > ---------
 > # Rename the “UTF8” Flag
 > ## Preamble
 > ```
 > Author:  FELIPE
 > Sponsor:
 > ID:      ?
 > Status:  Draft
 > ```
 > ## Abstract
 > Perl’s “UTF8 flag” confuses Perl users, and even occasionally its
 > maintainers. This RFC proposes to rename it in source code and
 > documentation, retaining old names as aliases to avoid breaking callers
 > of Perl’s C API (XS modules & embedders).
 > This RFC proposes the replacement term “heavy”: `SvHEAVY`, etc.

Can I suggest something like "multibyte", and also some small changes in 
Devel::Peek so that it does something like this?

$ perl -MDevel::Peek -E 'Dump(chr(0x3bb))';
SV = PV(0x7fc7d100b690) at 0x7fc7d1024d90
   REFCNT = 1
   PV = 0x7fc7d0c0be10 "\x{ce}\x{bb}"\0 [Characters "\x{3bb}"]
   CUR = 2
   LEN = 10

note "MULTIBYTE" in the flags, that I've put "Characters" in the 'PV =' 
line where it currently says "UTF8" (clearer, I think, than saying 
"multibyte" again), and that I've changed it from octal \316\273 to hex 
\x{ce}\x{bb} because for most people hex values are more immediately 
recognisable and it would be consistent with use of \x{...} in the list 
of characters.

I know "multibyte" is more to type, but I think it better explains what 
the flag is for.

David Cantrell

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