|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-06-09 13:17 UTC] thomas dot jarosch at intra2net dot com
Description: ------------ Hello together, I tried to encode german umlauts using imap_utf7_encode(), but the computed string is not understood by the cyrus IMAP server. This is pretty much related to bug #15630, but now I had the help of a coworker who is pretty fast decoding base64 by hand :-) UTF-7 is defined to encode special characters as two byte UTF-16 stream. Normally the ISO-8859-1 string "t?st" should be encoded into t&AOQ-st, which corresponds to 0x00, 0xe4. The current code in PHP 5.2.6 encodes it to t&5A-st, which is 0xe4 without the leading 0x00. Would be nice if that could be resolved since it's not compatible with most IMAP implementations. Bug #15630 is around since 2002. Cheers, Thomas Reproduce code: --------------- echo imap_utf7_encode("t?st"); Expected result: ---------------- t&AOQ-st Actual result: -------------- t&5A-st PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 14:00:01 2025 UTC |
Here is short and reliable test: # sapi/cli/php -r '$tst = mb_convert_encoding("t?st", "ISO-8859-1", "UTF8"); echo $tst, "\n"; echo imap_utf7_encode($tst), "\n", mb_convert_encoding($tst, "UTF7-IMAP", "ISO-8859-1"), "\n";'