Re: iconv vs. mbstring

From: Date: Thu, 05 Mar 2020 11:59:45 +0000
Subject: Re: iconv vs. mbstring
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-108866@lists.php.net to get a copy of this message
On 03.03.2020 23:16, Christoph M. Becker wrote: > For users learning PHP, and also for new code, it would be beneficial to > not have to decide which of these extensions to use; if they need > character encoding conversion, iconv() would be preferable; for more > general string functionality, it would be ext/mbstring. From my experience iconv does not support all charsets e.g. UTF7-IMAP or ISO-2022-JP-MS, that mbstring does. Also, I have a case in which iconv_* functions were much much slower than mbstring. See wordwrap implementation in https://github.com/roundcube/roundcubemail/blob/master/program/lib/Roundcube/rcube_mime.php#L589 I did not do any performance comparison for iconv() function itself and I'm not sure it should be considered preferable. I saw a lot of performance improvements in mbstring in the last year or so. Do anyone have some perf. comparison for charset conversion cases? -- Aleksander Machniak Kolab Groupware Developer [https://kolab.org] Roundcube Webmail Developer [https://roundcube.net] ---------------------------------------------------- PGP: 19359DC1 # Blog: https://kolabian.wordpress.com

« previous php.internals (#108866) next »