Re: Re: Regarding the latest patch on fgetcsv() (stable branch)

From: Date: Sat, 13 Dec 2003 01:54:50 +0000
Subject: Re: Re: Regarding the latest patch on fgetcsv() (stable branch)
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-6398@lists.php.net to get a copy of this message
On 2003/12/13, at 10:47, Rasmus Lerdorf wrote:
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

« previous php.internals (#6398) next »