# fgetcsv() conclusion

- Thread: https://externals.io/message/6661
- Original archive: https://news-web.php.net/php.internals/6661
- Started by Ilia Alshanetsky on 2003-12-21T18:12:52+00:00
- Messages: 4
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #6661 — Ilia Alshanetsky — 2003-12-21T18:12:52+00:00

URL: https://externals.io/message/6661#6661

It's been a few days since the last comments regarding the `fgetcsv()` in PHP 
5.0 and I think it would be an opportune time to decide on a solution for the 
problem. Based on the various commentary we appear to have 3 alternatives 
that for better or worse would resolve the situation.

1) Leave things they way they are now, giving everyone a partial support for 
multibyte string in `fgetcsv()` and 2-3 performance decrease in all instances.

2) Backport `fgetcsv()` from 4.3.X tree, giving everyone a fast variant of the 
function and introduce a fully multibyte mb_fgetcsv() into mbstring extension 
based on the current `fgetcsv()` in PHP 5.0.

3) Put the php_mblen macro in php_string.h inside ifdef HAVE_MBSTRING, which 
would disable multibyte functionality of `fgetcsv()` for people without 
mbstring support in their installation. This would just about restore 
performance and at the same time leave multibyte support for people who need 
it (use mbstring extension).


My personal preference is option #2.

Ilia

---

## #6667 — Moriyoshi Koizumi — 2003-12-21T23:25:59+00:00

URL: https://externals.io/message/6661#6667 · In reply to: #6661

> 1) Leave things they way they are now, giving everyone a partial 
> support for
> multibyte string in `fgetcsv()` and 2-3 performance decrease in all 
> instances.

Of course this is my choice.

> 3) Put the php_mblen macro in php_string.h inside ifdef HAVE_MBSTRING, 
> which
> would disable multibyte functionality of `fgetcsv()` for people without
> mbstring support in their installation. This would just about restore
> performance and at the same time leave multibyte support for people 
> who need
> it (use mbstring extension).

Why should we set up a relation to only mbstring extension here? I think
HAVE_ICONV should be take into consideration as well in case we choose
this option after all.

Regards,
Moriyoshi

---

## #6670 — Christian Schneider — 2003-12-22T10:03:29+00:00

URL: https://externals.io/message/6661#6670 · In reply to: #6667

Moriyoshi Koizumi wrote:
> > […]
> 
> Of course this is my choice.

I'm not sure this is what you want because the words "_partial_ support" 
seem to be the catch here. I guess Ilia argues that the current way is 
broken.

- Chris

---

## #6674 — Moriyoshi Koizumi — 2003-12-22T11:30:37+00:00

URL: https://externals.io/message/6661#6674 · In reply to: #6670

Christian Schneider <cschneid@cschneid.com> wrote:

> Moriyoshi Koizumi wrote:
> > […]
> 
> I'm not sure this is what you want because the words "_partial_ support" 
> seem to be the catch here. I guess Ilia argues that the current way is 
> broken.

What Ilia is mentioning as "partial support" is that the current 
implementation can not handle multibyte delimiters and enclosures,
which I don't find necessary. I've never encountered a real situation 
that requires multibyte delimiters or enclosures. Did you read through
the entire thread..?

Moriyoshi
