> I disagree with case 2 as it is described. You don't want to truncate in > the middle of a grapheme, if you in fact have graphemes.
I didn't intend to say that - the only difference between 1 and 2 is that in 2 the buffer is a character-length buffer and presumably you'd have a character index that you'd like to use in $start. But grapheme_extract always returns whole graphemes regardless of any option or there's no point to it. Stas brought up the idea of having $start be a reference so the routine could update it to the next position. I think that might solve some problems in the caller's code. $start could still be defined as any of bytes, characters, or graphemes and it would be updated respecting that. What do you think? If we do that, the user might be perfectly happy with only a "byte flavor" of $start in many simple cases since they don't need to do anything extra to iterate through the original string - they can always get a grapheme count or character count if they need it by making a function call. =Ed -- PHP Unicode & I18N Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php