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

Re: Pre-RFC: Rename SVf_UTF8 et al.

Thread Previous | Thread Next
From:
Felipe Gasper
Date:
August 20, 2021 13:23
Subject:
Re: Pre-RFC: Rename SVf_UTF8 et al.
Message ID:
C1AF18D4-2D47-429F-A514-100BAD96EC58@felipegasper.com

> On Aug 20, 2021, at 3:04 AM, Sergey Aleynikov <sergey.aleynikov@gmail.com> wrote:
> 
> ср, 18 авг. 2021 г. в 20:17, Felipe Gasper <felipe@felipegasper.com>:
>> The problem here is the naming. For example, consider `perl -e'my $foo = "é"'`. In this code $foo is a “UTF-8 string” by virtue of the fact that its code points (assuming use of a UTF-8 terminal) correspond to the bytes that encode “é” in UTF-8. The “UTF-8 flag”, however, is likely *not* set on this string
> 
> There's no likeness. For literal string, there're deterministic rules
> set (though they may not be documented).

They’re not documented; ergo, they can change at any time. This is by design, right? A Perl application should not have to think about how Perl stores its code points?

> what really makes things this messy is this flag's mere existence
> (and it still might be better than Python's choice for theirs Unicode
> strings).

Out of curiosity, what do you think would be the ideal? Store all strings internally as UTF-8, à la Rust?

-F
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