Re: iconv vs. mbstring

From: Date: Thu, 05 Mar 2020 14:33:28 +0000
Subject: Re: iconv vs. mbstring
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-108870@lists.php.net to get a copy of this message
On Thu, 5 Mar 2020 at 11:59, Aleksander Machniak <alec@alec.pl> wrote: > > Also, I have a case in which iconv_* functions were much much slower > than mbstring. See wordwrap implementation in > > �>8… > l[G�y€màEyhttps://github.com/roundcube/roundcubemail/blob/master/program/lib/Roundcube/rcube_mime.php#L589 > > Either I misread, or you did: I thought that's exactly what Christoph was saying, that iconv_* functions will be slower because they basically do convert-process-unconvert rather than having implementations for each encoding. So mb_strlen will always be faster than iconv_strlen. iconv() vs mb_convert_encoding() doesn't have the same penalty. It seems quite plausible that a library dedicated to converting charsets would be more optimised for that job than a single function in a larger library mainly focussed on working with one charset at a time. Regards, -- Rowan Tommins [IMSoP]

« previous php.internals (#108870) next »