On Sat, 13 Dec 2003, Steph wrote:If you get multibyte data from a form and want to perform string
operations on
it such as strlen(), ereg(), etc... would you not need mb_* or iconv_*
functions?
In such a case, yes, I do. But I don't think that's directly related to the issue..?
The real question is, what does mbstring do that iconv fails to do? And why
do we need to restore the initial form in any sense? And if iconv were
built-in, would mbstring still be needed, and if so, why and where?
The cool thing that mbstring provides is transparent overloading of some
of the common string manipulation functions. This means that at least for
a subset of applications, even though they may not have been written with
multibyte support in mind, they may in fact work perfectly in a multibyte
environment with mbstring enabled and overloading turned on.
Overloading is evil, because functions like substr() are often used to splice a certain length of octets byte-wise while mb_substr() treats the sequence of octets on a character-basis. And overloading cannot be turned on in scripts, this prevents us from writing portable scripts. There're virtually no cleaner way to do the tasks elegantly.
Moriyoshi
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php