Re: [RFC] Desire to move RFC add_str_begin_and_end_functions to a vote
| From: | AllenJB | Date: | Mon, 24 Jun 2019 22:13:04 +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 9 10 11 12 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-106049@lists.php.net to get a copy of this message | ||
On 24/06/2019 10:28, Nikita Popov wrote:
On Sun, Jun 23, 2019 at 5:46 PM Nikita Popov <nikita.ppv@gmail.com> wrote: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? AllenJBOn Sun, Jun 23, 2019 at 5:30 PM Ben Ramsey <ben@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