From:             
Operating system: GNU/linux (gentoo/kernel 2.6.35)
PHP version:      5.3.5
Package:          Mail related
Bug Type:         Bug
Bug description:iconv_mime_encode() fails converting UTF-8 string to 
quoted-printable

Description:
------------
iconv_mime_encode() fails on certain UTF-8 strings containing at least one
multibyte character. The error is reproducable for these strings.



I have further noticed that it is more likely that this error occurs if a
multibyte character is found at the following character positions within
the string:

24±1, 52±3, 82±4, 112±5, 143±5



The code that led me to the previous conclusion can be found here:
http://pastebin.com/GXQZ129M

Test script:
---------------
$preferences = array(

    'scheme' => 'Q',

    'input-charset'  => 'utf-8',

    'output-charset' => 'utf-8',

    'line-length' => 74,

    'line-break-chars' => "\r\n",

);

// Note the ellipsis character at the end of the following string:

iconv_mime_encode('subject', "d obeybiubrsfqllpdtpge…", $preferences);

Actual result:
--------------
PHP Notice:  iconv_mime_encode(): Unknown error (7) in
/home/soulmerge/test.php on line 11



Notice: iconv_mime_encode(): Unknown error (7) in /home/soulmerge/test.php
on line 11





-- 
Edit bug report at http://bugs.php.net/bug.php?id=53891&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=53891&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=53891&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=53891&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=53891&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=53891&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=53891&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=53891&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=53891&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=53891&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=53891&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=53891&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=53891&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=53891&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=53891&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=53891&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=53891&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=53891&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=53891&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=53891&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=53891&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=53891&r=mysqlcfg

Reply via email to