Doc #71357 [Opn->Csd]: mb_encode_mimeheader(): confusing description of $charset

From: Date: Wed, 13 Jan 2016 22:31:56 +0000
Subject: Doc #71357 [Opn->Csd]: mb_encode_mimeheader(): confusing description of $charset
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-13096@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71357&edit=1 ID: 71357 Updated by: takagi@php.net Reported by: m dot unarist at gmail dot com Summary: mb_encode_mimeheader(): confusing description of $charset -Status: Open +Status: Closed Type: Documentation Problem Package: Documentation problem PHP Version: Irrelevant -Assigned To: +Assigned To: takagi Block user comment: N Private report: N New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2016-01-13 22:28:09] takagi@php.net Automatic comment from SVN on behalf of takagi Revision: http://svn.php.net/viewvc/?view=revision&revision=338480 Log: Correct misleading parameter description Close #71357 ------------------------------------------------------------------------ [2016-01-13 12:04:18] m dot unarist at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=71357&edit=1

« previous php.doc.bugs (#13096) next »