On 24/06/2019 10:28, Nikita Popov wrote:
On Sun, Jun 23, 2019 at 5:46 PM Nikita Popov <nikita....@gmail.com> wrote:

On Sun, Jun 23, 2019 at 5:30 PM Ben Ramsey <b...@benramsey.com> wrote:

The reason why this doesn't work is that mb_stripos internally performs a
simple case fold, while a full case fold would be needed in this case
(Turkish i is hard). It's a bit tricky due to the need to remap character
offsets.

I've implemented use of full case folding in
https://github.com/php/php-src/pull/4303. While doing that I kind of
convinced myself that we probably shouldn't actually do this, because it
breaks simple mb_stripos loops in a subtle way. It probably makes more
sense for people to explicitly call mb_convert_case($string, MB_CASE_FOLD)
and then operate on the resulting strings. Both much more efficient, and
avoids offset remapping issues.

Nikita


If these functions (mb_stripos and any others affected by the same issue) are not the recommended way, and may not act as users expect, should they be deprecated?

Or at least notes added to the manual pages regarding this behavior / the differences between the different methods?


AllenJB


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to