From: thomas dot jarosch at intra2net dot com
Operating system: linux
PHP version: 5.2.6
PHP Bug Type: IMAP related
Bug description: imap_utf7_encode() computes wrong UTF-7 data
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
--
Edit bug report at http://bugs.php.net/?id=45213&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=45213&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=45213&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=45213&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45213&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=45213&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45213&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45213&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45213&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45213&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45213&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=45213&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=45213&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45213&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45213&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45213&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45213&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45213&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45213&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45213&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45213&r=mysqlcfg