Bug #66828 [NEW]: iconv_mime_encode quoted-printable result longer than it should be

From: Date: Wed, 05 Mar 2014 19:04:40 +0000
Subject: Bug #66828 [NEW]: iconv_mime_encode quoted-printable result longer than it should be
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184535@lists.php.net to get a copy of this message
From: st_9876543210 at yahoo dot de Operating system: PHP version: Irrelevant Package: ICONV related Bug Type: Bug Bug description:iconv_mime_encode quoted-printable result longer than it should be Description: ------------ Instead of wrapping a whole quotes-printabled line into =?UTF-8?Q? and ?=, iconv_mime_encode() sometimes splits a line into 2 parts each surrounded by the mentioned parts. While this seams to be still standard-compliant it makes the resulting string longer than it should be. My example would perfectly fit into one line but instead it needs 2 lines. This also happens when having longer strings (having this issue on every line of the output!) and regardless of what characters are used. This could to be caused by the bug fix for https://bugs.php.net/bug.php?id=48289. Test script: --------------- <?php $preferences = array( "input-charset" => "ISO-8859-1", "output-charset" => "UTF-8", "line-length" => 76, "line-break-chars" => "\n", "scheme" => "Q" ); var_dump(iconv_mime_encode("Subject", "Test Test Test Test Test Test Test Test", $preferences)); Expected result: ---------------- string(67) "Subject: =?UTF-8?Q?Test=20Test=20Test=20Test=20Test=20Test=20Test?=" Actual result: -------------- string(93) "Subject: =?UTF-8?Q?Test=20Test=20Test=20Tes?==?UTF-8?Q?t=20Test?= =?UTF-8?Q?=20Test=20Test?=" -- Edit bug report at https://bugs.php.net/bug.php?id=66828&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66828&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66828&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66828&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=66828&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=66828&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=66828&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=66828&r=needscript Try newer version: https://bugs.php.net/fix.php?id=66828&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=66828&r=support Expected behavior: https://bugs.php.net/fix.php?id=66828&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=66828&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=66828&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=66828&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66828&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=66828&r=dst IIS Stability: https://bugs.php.net/fix.php?id=66828&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=66828&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=66828&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=66828&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=66828&r=mysqlcfg

« previous php.bugs (#184535) next »