RE: [PHP-I18N] proposal: unification of the grapheme_extract functions
[email protected] ("Ed Batutis") Tue, 13 May 2008 17:26:55 -0400
| Newsgroups | php.i18n |
|---|---|
| Message-ID | <[email protected]> |
> A variation of the proposal might be ... I like it. I vote for: Add a new optional parameter on the end - called $next - that is a reference that will receive the offset just past the end of the returned string. The caller can use the same variable for $start and $next if they don't want to have to manually assign the value in their own code. I will add the three options for the meaning of 'start' as well with the default being 'byte'. The returned $next value will respect the value of that option. If no one objects I'll put that in. > The right solution (to my mind) is to have some meta data maintained with > strings and store position and other info about the strings to improve > performance without involving programmers and letting people program > strings without caring about encoding or architecture. That is an > opportunity for php 6. Sounds like a break iterator with a bit of extra info to support multiple encodings. Or perhaps you mean to wrap all string operations? =Ed