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

Re: RFC: Rename the “UTF8” flag

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
February 4, 2022 14:32
Subject:
Re: RFC: Rename the “UTF8” flag
Message ID:
c6dcf37c-8a83-4230-8d61-d1720acb717f@beta.fastmail.com
On Thu, Feb 3, 2022, at 10:05 PM, Felipe Gasper wrote:
> Tony wrote: 
> > The UTF8 flag does what it says on the box - indicates the PV is
> > encoded using (something like) UTF-8.
> 
> Oof. If a pure-Perl user read that description, do you see how that person would reasonably reach for utf8::is_utf8()?

Just to call out this one point:  I think that there's a distinction to be drawn between the SvUTF8 flag and utf8::is_utf8.  I get that it's nice to have "is-X" match the "X" flag, but I here, I think it's a bit of a complicated pain in the butt.

*That said*, I also think that it's utf8::is_utf8 that leads to the mass of confusion.  Providing a "is this string stored in internal format A or B" builtin to use _instead_ is a better idea.  I would support something more like:
 * provide builtin::internal_string_format that returns 'blue' or 'green'
 * discourage using utf8::is_utf8, explaining "it's not what you think it is"
 * leave the SV flags how they are
-- 
rjbs
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