php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55314 wrong mb_decode_mimeheader result
Submitted: 2011-07-29 07:28 UTC Modified: 2011-08-01 01:53 UTC
From: donglijun at msn dot com Assigned:
Status: Closed Package: mbstring related
PHP Version: 5.3.6 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: donglijun at msn dot com
New email:
PHP Version: OS:

 

 [2011-07-29 07:28 UTC] donglijun at msn dot com
Description:
------------
Using mb_decode_mimeheader to decode a mime string, but got a wrong result

Test script:
---------------
<?php
mb_internal_encoding('UTF-8');
var_dump(mb_decode_mimeheader('=?UTF-8?B?cHl0aG9uILLiytTTyrz+?='));

Expected result:
----------------
string(15) "python 测试邮件"

Actual result:
--------------
string(9) "python 始"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-29 07:55 UTC] laruence@php.net
-Status: Open +Status: Feedback
 [2011-07-29 07:55 UTC] laruence@php.net
hmm, did you get "'=?UTF-8?B?cHl0aG9uILLiytTTyrz+?='" by mb_encode_mimeheader,  if not plz check the original text before encoding.

after you double check it, if you still believe this is a bug of PHP, plz supply the encoding script, then change the bug status from Feedback to Open again.
 [2011-08-01 01:53 UTC] donglijun at msn dot com
-Status: Feedback +Status: Closed
 [2011-08-01 01:53 UTC] donglijun at msn dot com
The text is not encoded by mb_encode_mimeheader, but generated by a python 
sendmail script. I checked the decoded string again and found that the source 
string's charset may be GB2312 and was marked UTF-8 by encoder. So i choose to 
close this bug and sorry for this mistake.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 17:01:33 2024 UTC