Doc #71357 [NEW]: mb_encode_mimeheader(): confusing description of $charset
| From: | m dot unarist at gmail dot com | Date: | Wed, 13 Jan 2016 12:04:22 +0000 |
| Subject: | Doc #71357 [NEW]: mb_encode_mimeheader(): confusing description of $charset | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-13095@lists.php.net to get a copy of this message | ||
From: m dot unarist at gmail dot com
Operating system:
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:mb_encode_mimeheader(): confusing description of $charset
Description:
------------
---
From manual page: http://www.php.net/function.mb-encode-mimeheader
---
> charset specifies the name of the character set in which str is
represented in.
I assume "input parameter $str is encoded with $charset" from this
sentence, but $charset specifies the character set which is used for the
output encoding (i.e. the name will be shown in between "=?" and "?B?"
of the MIME header), the input encoding is mb_internal_encoding().
At least, Japanese translation can be read "$charset is the character
set name of $str". I think it's wrong.
> mb_internal_encoding() should be set to same encoding.
$str should be represented in same encoding as mb_internal_encoding().
$charset is not related to mb_internal_encoding(), so this sentence
should be in the description of $str.
Test script:
---------------
mb_internal_encoding('UTF-8');
mb_language('ja');
$str = "\xe3\x81\x82"; // Japanese string
echo mb_encode_mimeheader($str, 'ISO-2022-JP');
// =?ISO-2022-JP?B?GyRCJCIbKEI=?=
echo mb_encode_mimeheader($str, 'UTF-8');
// =?UTF-8?B?44GC?=
--
Edit bug report at https://bugs.php.net/bug.php?id=71357&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71357&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71357&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71357&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71357&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71357&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71357&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71357&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71357&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71357&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71357&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71357&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71357&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71357&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71357&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71357&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71357&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71357&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71357&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71357&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71357&r=mysqlcfg