Re: [RFC] Desire to move RFC add_str_begin_and_end_functions to a vote
| From: | Nikita Popov | Date: | Sat, 22 Jun 2019 20:43:43 +0000 |
| Subject: | Re: [RFC] Desire to move RFC add_str_begin_and_end_functions to a vote | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-106038@lists.php.net to get a copy of this message | ||
On Sat, Jun 22, 2019 at 10:27 PM Bruce Weirdan <weirdan@gmail.com> wrote:
> On Sat, Jun 22, 2019 at 6:32 PM Nikita Popov <nikita.ppv@gmail.com> wrote:
> >
> > The normal str_starts_with() function is perfectly safe to use on UTF-8
> strings,
>
> Only if you assume strings to be normalized to the same form. Checking if
> NFC
> string starts with NFD substring by checking them bit by bit is going
> to yield false negatives [1]
>
> [1] https://3v4l.org/4HgUL
>
That's correct, but not really relevant in the context of the discussion,
as mbstring does not perform Unicode normalization, so mb_* functions
wouldn't change anything about this. (Not that basic string operations
should be performing implicit Unicode normalization...)
Nikita