#32586 [NEW]: imap_utf7_encode doesn't work as expected
| From: | mschering at intermesh dot nl | Date: | Tue, 05 Apr 2005 10:54:16 +0000 |
| Subject: | #32586 [NEW]: imap_utf7_encode doesn't work as expected | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-76377@lists.php.net to get a copy of this message | ||
From: mschering at intermesh dot nl
Operating system: Linux 2.6
PHP version: 4.3.10
PHP Bug Type: IMAP related
Bug description: imap_utf7_encode doesn't work as expected
Description:
------------
These functions do not work:
/**
* Replacement for $this->utf7_encode because it expects the text to be
in
* ISO-8859-1 format while GO uses UTF-8.
*
* @access public
* @param $text The UTF-8 encoded text to encode in UTF-7
* @return string UTF-7 encoded text
*/
function utf7_encode($text)
{
return imap_utf7_encode(utf8_decode($text));
}
/**
* Replacement for $this->utf7_decode becuase it returns the text in
* ISO-8859-1 format while GO uses UTF-8.
*
* @access public
* @param $text The UTF-7 text to encode to UTF-8
* @return string UTF-8 encoded text
*/
function utf7_decode($text)
{
return utf8_encode(imap_utf7_decode($text));
}
}
Reproduce code:
---------------
Use these functions and encode UTF-8 strings with characters like ëäö etc
in it and it will produce garbage.
I use these in my mail client and it works but other mail clients do not
see the folders correctly.
Expected result:
----------------
Other mail clients should see the folder names correctly
Actual result:
--------------
The folder names have strange characters in other mail clients
--
Edit bug report at http://bugs.php.net/?id=32586&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32586&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32586&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32586&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32586&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32586&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32586&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32586&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32586&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32586&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32586&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=32586&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=32586&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32586&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32586&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32586&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32586&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32586&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32586&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32586&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32586&r=mysqlcfg