|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76958 Broken UTF7-IMAP conversion
Submitted: 2018-10-02 06:38 UTC Modified: 2018-10-02 14:17 UTC
From: Assigned: nikic (profile)
Status: Closed Package: mbstring related
PHP Version: 7.3.0RC2 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
New email:
PHP Version: OS:


 [2018-10-02 06:38 UTC]
I'm testing PHP 7.3.0RC2 (cli) (built: Oct  1 2018 11:46:48) ( NTS ) Ondrej's PPA on Ubuntu 18.04. It looks like conversion to/from UTF7-IMAP encoding is broken. See simple test script. It works as expected on PHP <= 7.2.

Test script:
echo mb_convert_encoding($str, 'UTF-8', 'UTF7-IMAP') . "\n";
$str = 'Рассылки';
echo mb_convert_encoding($str, 'UTF7-IMAP', 'UTF-8') . "\n";

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-10-02 06:49 UTC]
Sorry, I cut one character from the actual result. It looks like this:

 [2018-10-02 09:14 UTC]
-Status: Open +Status: Verified
 [2018-10-02 09:14 UTC]
Confirmed: <>.
 [2018-10-02 12:56 UTC]
-Status: Verified +Status: Assigned -Assigned To: +Assigned To: nikic
 [2018-10-02 12:56 UTC]
Looks like I missed this encoding when moving convert_vtbl pointers into mbfl_encoding.
 [2018-10-02 14:15 UTC]
Automatic comment on behalf of
Log: Fixed bug #76958
 [2018-10-02 14:15 UTC]
-Status: Assigned +Status: Closed
 [2018-10-02 14:17 UTC]
Some additional hardening implemented in, to make sure that such issues result in an error, rather than mbstring doing god knows what.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Oct 01 04:05:52 2022 UTC