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

Re: Pre-RFC: New C API for converting from UTF-8 to code point

Thread Previous | Thread Next
From:
hv
Date:
July 1, 2022 22:46
Subject:
Re: Pre-RFC: New C API for converting from UTF-8 to code point
Message ID:
202207012229.261MTEP28487@crypt.org
Karl Williamson <public@khwilliamson.com> wrote:
: From reading that discussion, I think you would be more comfortable 
:with something like this:
:
:     while (s < e) {
:         if (! next_uvchr(s, e, &ret_cp, &ret_len)) {
:             ... process error ...
:         }
:         else {
:             ... process code_point ...
:         }
:
:         s += ret_len;
:     }

That certainly feels like a cleaner design to me, by avoiding the
overloading of ret_len to have multiple meanings.

:I would consider this.  I designed the original proposal to be more of a 
:drop-in replacement for the current one.  But this one gets rid of the 
:flag to say you want errors, and might be close enough to drop-in.  I 
:await more people to weigh-in.

Thanks for considering it.

Hugo

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