php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80626 Passing 'pass' to mb_convert_encoding()'s $from_encoding not working since 7.3
Submitted: 2021-01-14 18:39 UTC Modified: 2021-01-24 04:22 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:2 (66.7%)
From: powtac at gmx dot de Assigned:
Status: No Feedback Package: mbstring related
PHP Version: 7.4.14 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: powtac at gmx dot de
New email:
PHP Version: OS:

 

 [2021-01-14 18:39 UTC] powtac at gmx dot de
Description:
------------
According to the docs 'pass' is an option for the third parameter of mb_convert_encoding() (https://php.net/function.mb-convert-encoding), see https://www.php.net/manual/en/mbstring.supported-encodings.php where it says:

"Any php.ini entry which accepts an encoding name can also use the values "auto" and "pass". mbstring functions which accept an encoding name can also use the value "auto". If "pass" is set, no character encoding conversion is performed." 

But actually an Warning occurs when using 'pass' at mb_convert_encoding() from PHP 7.3, it used to work without Warning before PHP 7.3.

See https://3v4l.org/fbRiW#output

Test script:
---------------
<?php
// https://3v4l.org/fbRiW#output
echo mb_convert_encoding('a', 'UTF-8', 'pass');
?>

Expected result:
----------------
No warning should occur or the docs need to be adjusted for the 'pass' parameter. 

Actual result:
--------------
Warning: mb_convert_encoding(): Unable to create character encoding converter in ... on line ...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-01-14 18:45 UTC] requinix@php.net
-Status: Open +Status: Feedback -Type: Bug +Type: Documentation Problem -Package: Documentation problem +Package: mbstring related
 [2021-01-14 18:45 UTC] requinix@php.net
Were the docs changed at the same time as 7.3.0? Because according to what it says now, "pass" is only allowed for a php.ini setting. It means not to perform any conversion at all, and it doesn't make sense to support that in normal function calls.
 [2021-01-24 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 11:01:30 2024 UTC