|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-02-11 11:30 UTC] steffen at dislabs dot de
Description:
------------
using imap_utf8 returns only capitols.
This behavior changed with 5.2.5 as it worked in 5.2.4 correct.
Reproduce code:
---------------
echo imap_utf8('=?iso-8859-1?b?THV6b26uMTQ=?= dot CoM');
Expected result:
----------------
Luzon?14 dot CoM
Actual result:
--------------
LUZON?14 DOT COM
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 13:00:02 2025 UTC |
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