Re: Re: Regarding the latest patch on fgetcsv() (stable branch)
| From: | Moriyoshi Koizumi | Date: | Sat, 13 Dec 2003 01:50:03 +0000 |
| Subject: | Re: Re: Regarding the latest patch on fgetcsv() (stable branch) | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-6397@lists.php.net to get a copy of this message | ||
On 2003/12/13, at 10:43, Steph wrote:
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?I wrote we need to restore it to the initial form because we want to emulate exactly the same behaviour as the current fgetcsv() works. As fgetcsv() without a stream filter doesn't perform any conversion, so once we've turned the input into another encoding, then we have to turn it back. In this case, we're trying to convert strings encoded in an encoding other than UTF-8 into UTF-8 first, and parse it through fgetcsv(). Here what you get are UTF-8 version of these, which is unwanted. You might say the products will suffice even if they are UTF-8 encoded, however the conversion is sometimes irreversible, so we then need to avoid any conversion stuff. ("irreversible" means you would be supposed to lost some information during the conversion.) Moriyoshi