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

Re: Pre-RFC: Rename SVf_UTF8 et al.

Thread Previous | Thread Next
From:
Yuki Kimoto
Date:
August 19, 2021 01:09
Subject:
Re: Pre-RFC: Rename SVf_UTF8 et al.
Message ID:
CAExogxOQG4V6LisBe=GYaa1Xc+Bu1yzBLs1_YS5k9H8BL02qhw@mail.gmail.com
2021-8-19日 2:17 Felipe Gasper <felipe@felipegasper.com> wrote:

> Per recent IRC discussion …
>
> PROBLEM: The naming of Perl’s “UTF-8 flag” is a continual source of
> confusion regarding the flag’s significance. Some think it indicates
> whether a given PV stores text versus binary. Some think it means that the
> PV is valid UTF-8. Still others likely hold other inaccurate views.
> h, be an auspicious confusion that eventually clarifies rather than
> misleads.


 I feel that the starting point for this discussion is that people
misunderstand that the current Perl implementation can distinguish between
binary and text.

On this point, I agree with Feripe.

People likely to believe

utf8::is_utf8 : 0 : this string is binary
utf8::is_utf8 : 1 : this string is text

However, this is completely wrong.

Current Perl can't make this distinction.

Perl freely changes this interpretation for performance and use.

The meaning is as follows.

・Interpretation considered bytes
・Interpretation considered UTF-8 characters

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