#44098 [Com]: imap_utf8() returns only capital letters

From: Date: Thu, 29 Oct 2009 22:54:09 +0000
Subject: #44098 [Com]: imap_utf8() returns only capital letters
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-144093@lists.php.net to get a copy of this message
ID: 44098 Comment by: sbs at hushmail dot com Reported By: steffen at dislabs dot de Status: No Feedback Bug Type: IMAP related Operating System: FreeBSD 6.2 PHP Version: 5.2.5 Assigned To: fb-req-jani New Comment: This is because if you compile against a recent version of the imap c-client library, the U8T_CANONICAL flag is passed to utf8_mime2text, which canonicalizes case. To fix, instead the U8T_DECOMPOSE compose flag can be used. No flag at all would likely be fine as well. Here's a patch I used against 5.2.11. diff -r -u php-5.2.11/configure php-5.2.11-u8t_decompose-patch/configure +++ php-5.2.11-u8t_decompose-patch/configure 2009-10-29 15:23:14.000000000 -0700 -if eval "test \"echo '$''{'ac_cv_u8t_canonical'+set}'\" = set"; then +if eval "test \"echo '$''{'ac_cv_u8t_decompose'+set}'\" = set"; then - ac_cv_u8t_canonical=yes + ac_cv_u8t_decompose=yes - ac_cv_u8t_canonical=no + ac_cv_u8t_decompose=no -echo "$ac_t""$ac_cv_u8t_canonical" 1>&6 +echo "$ac_t""$ac_cv_u8t_decompose" 1>&6 - if test "$ac_cv_u8t_canonical" = "no" && test "$ac_cv_utf8_mime2text" = "new"; then + if test "$ac_cv_u8t_decompose" = "no" && test "$ac_cv_utf8_mime2text" = "new"; then - if test "$ac_cv_u8t_canonical" = "yes" && test "$ac_cv_utf8_mime2text" = "old"; then + if test "$ac_cv_u8t_decompose" = "yes" && test "$ac_cv_utf8_mime2text" = "old"; then diff -r -u php-5.2.11/ext/imap/config.m4 php-5.2.11-u8t_decompose-patch/ext/imap/config.m4 +++ php-5.2.11-u8t_decompose-patch/ext/imap/config.m4 2009-10-29 15:21:22.000000000 -0700 - AC_CACHE_CHECK(for U8T_CANONICAL, ac_cv_u8t_canonical, + AC_CACHE_CHECK(for U8T_DECOMPOSE, ac_cv_u8t_decompose, - ac_cv_u8t_canonical=yes + ac_cv_u8t_decompose=yes - ac_cv_u8t_canonical=no + ac_cv_u8t_decompose=no - if test "$ac_cv_u8t_canonical" = "no" && test "$ac_cv_utf8_mime2text" = "new"; then + if test "$ac_cv_u8t_decompose" = "no" && test "$ac_cv_utf8_mime2text" = "new"; then - if test "$ac_cv_u8t_canonical" = "yes" && test "$ac_cv_utf8_mime2text" = "old"; then + if test "$ac_cv_u8t_decompose" = "yes" && test "$ac_cv_utf8_mime2text" = "old"; then diff -r -u php-5.2.11/ext/imap/php_imap.c php-5.2.11-u8t_decompose-patch/ext/imap/php_imap.c +++ php-5.2.11-u8t_decompose-patch/ext/imap/php_imap.c 2009-10-29 15:21:38.000000000 -0700 Previous Comments: ------------------------------------------------------------------------ [2009-07-10 20:53:54] ftourist at yahoo dot com Same bug on Windows Server 2008 Installed using php-5.3.0-nts-Win32-VC9-x86.msi ------------------------------------------------------------------------ [2009-04-15 08:39:21] tristan at byte dot nl We experience the same bug using php 5.2.9 on Debian Etch PHP 5.2.9-1byte1 (cli) (built: Mar 25 2009 17:08:35) 5.2.9.dfsg.1-1byte1 (5.2.9.dfsg.1-1, with some custom patches not related to utf8 or imap). libc-client is libc-client2007b (2007b~dfsg-2byte0etch0) ------------------------------------------------------------------------ [2009-03-24 01:43:03] lthomas at ethz dot ch Sorry, not Debian ETCH, it is Debian Lenny! ------------------------------------------------------------------------ [2009-03-24 01:42:22] lthomas at ethz dot ch Same problem with Debian Etch and libapache2-mod-php5. Exact debian package version is: 5.2.6.dfsg.1-1+lenny2. C-Client is:7:2007b~dfsg-4+lenny3 Workaround, as described in other notes, works great. ------------------------------------------------------------------------ [2008-07-02 13:28:24] giuseppe at serverplan dot com Hi, tried 5.2 snap php5.2-200807020830 with latest imap (imap-2007b) and the bug still there. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/44098 -- Edit this bug report at http://bugs.php.net/?id=44098&edit=1

« previous php.bugs (#144093) next »