Re: [PHP-I18N] proposal: unification of the grapheme_extract functions

[email protected] (Stanislav Malyshev) Mon, 12 May 2008 17:17:03 -0700
Newsgroups php.i18n
Organization Zend Technologies
Message-ID <[email protected]>
Hi!

> Tex could probably answer this better than I could, but I'll have a go.

OK, thanks! Picture is much clearer for me now. If you do it in a loop, 
then I think bytes should be enough, since you'd have to do 
strlen/grapheme_strlen in any case to know how much did you receive, so 
doing strlen is no worse than doing anything else, and you could always 
work with bytes there, and since grapheme_extract would always stop on 
grapheme boundary, I think you don't need to worry about bytes being not 
good enough for graphemes inside the string.

As an alternative, we could update $start with new "position" - i.e. old 
$start+how many bytes we returned, but I'm not sure if it's the best way.

Tex, what do you think?
-- 
Stanislav Malyshev, Zend Software Architect
[email protected]   http://www.zend.com/
(408)253-8829   MSN: [email protected]