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

Re: Proposal: Rename utf8::is_utf8() to utf8::is_upgraded()

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
February 20, 2017 23:19
Subject:
Re: Proposal: Rename utf8::is_utf8() to utf8::is_upgraded()
Message ID:
CAHhgV8i-gJhfZgXSLw2kT4=AtxA=uEK4VtigdLVbigEkXFs=Bg@mail.gmail.com
On Mon, Feb 20, 2017 at 9:46 PM, Kent Fredric <kentfredric@gmail.com> wrote:

>   *   "$flag = utf8::is_upgraded($string)"
>
>          (Since Perl 5.28) Test whether $string 's internal bytes are
> marked
>          for interpretation via utf8 semantics or not. Note this bears
> no impact on whether that
>          data is actually utf8, only how perl functions such as
> "length" should treat its bytes.
>
>  *   "$flag = utf8::is_utf8($string)"
>          (Since Perl 5.8.1) Compatibility-supporting (but poorly named)
> alias of
>          utf8::is_upgraded
>
>
> Its a bit wordy, but probably progress.
>

I think it would be helpful to explicitly mention that the whole «encode if
is_utf8» is essentially always wrong. And to link to a longer explanation
in perlunisomething of why it is wrong.

Though that said, I think we can find a clearer name than "is_upgraded"
>

is_multibyte?

Leon

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