Edit report at http://bugs.php.net/bug.php?id=53304&edit=1
ID: 53304 User updated by: daniel dot mueller at inexio dot net Reported by: daniel dot mueller at inexio dot net Summary: iconv_mime_docode() doesn't handle lowercase hex digits Status: Open Type: Bug Package: ICONV related -Operating System: FreeBSD 7.2-RELEASE +Operating System: all PHP Version: 5.3SVN-2010-11-13 (snap) Block user comment: N Private report: N New Comment: I have attached a fix for this problem. The patch changes php_quot_print_decode() in ext/standard/quot_print.c so, that it accepts the lowercase hex digits a-f. This function seems currently only used for mime header decoding according rfc2047 in ext/iconv/iconv.c However rfc2045 defines lowercase characters as illegal, but allows to recognize them as the corresponding uppercase letters in decoding. Previous Comments: ------------------------------------------------------------------------ [2010-11-13 10:31:56] daniel dot mueller at inexio dot net Description: ------------ iconv_mime_docode() doesn't handle lowercase hex digits in Q-encoding. According rfc2047 hex digits should be in uppercase, but it must not be in this way. Example: =c3=bc - gives error =C3=BC - works Test script: --------------- <?php error_reporting(E_ALL); echo iconv_mime_decode('=?utf-8?Q?Nachricht_=c3=bcber_Kontaktformular_www.inexio.net?=', 0, 'UTF-8') . "\n"; echo iconv_mime_decode('=?utf-8?Q?Nachricht_=C3=BCber_Kontaktformular_www.inexio.net?=', 0, 'UTF-8') . "\n"; ?> Expected result: ---------------- Nachricht über Kontaktformular www.inexio.net Nachricht über Kontaktformular www.inexio.net Actual result: -------------- Notice: iconv_mime_decode(): Unknown error (25) in /usr/home/dm/test.php on line 3 Nachricht über Kontaktformular www.inexio.net ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53304&edit=1