Re: [RFC] grapheme cluster for str_split, grapheme_str_split function
| From: | youkidearitai | Date: | Wed, 27 Mar 2024 00:48:04 +0000 |
| Subject: | Re: [RFC] grapheme cluster for str_split, grapheme_str_split function | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-122770@lists.php.net to get a copy of this message | ||
2024年3月27日(水) 6:18 Casper Langemeijer <langemeijer@php.net>:
>
> On Tue, Mar 26, 2024, at 18:15, Derick Rethans wrote:
>
> Many of these already exist, such as grapheme_substr. We can't simply change the behaviour
> of the already existing functions due to BC reasons.
>
>
> Wow. I feel very stupid. I feel I should have known about grapheme_*, but I didn't. Oh my,
> the manual says since PHP 5.3 no less. From what I've seen around being used, I'm far from
> the only one though. In an attempt to justify my own stupidity I searched its use and it's bad.
>
> Searching on github with language:PHP:
>
mb_strlen 84k files,
> grapheme_strlen 680
>
> Then a big number of first 100 of these files are stubs/polyfills/phpstan metadata. I've
> seen no framework except Symphony (but they might be further in the searchresults)
>
> The grapheme_str_split function, as well as other intl extension functions is what should
> replace mbstring really.
>
>
> YES!
>
> I'm sorry to have wasted your time. If you need someone to help for the grapheme_
> marketing team, let me know.
Hi, Casper
I think still useful mbstring functions. Because mbstring functions is
still valid as a bridge to non-Unicode character codes.
We think it makes sense for mbstring to calculate in Unicode code point units.
Therefore, I think make sense that separate mbstring functions and
grapheme functions.
Regards
Yuya
--
---------------------------
Yuya Hamada (tekimen)
- https://tekitoh-memdhoi.info
- https://github.com/youkidearitai
-----------------------------