php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32586 imap_utf7_encode doesn't work as expected
Submitted: 2005-04-05 12:54 UTC Modified: 2005-04-06 18:26 UTC
From: mschering at intermesh dot nl Assigned:
Status: Not a bug Package: IMAP related
PHP Version: 4.3.10 OS: Linux 2.6
Private report: No CVE-ID: None
 [2005-04-05 12:54 UTC] mschering at intermesh dot nl
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-06 18:26 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 19:01:29 2024 UTC