Bug #81676 [NEW]: Converting string to UTF using \mb_convert_encoding returns empty string

From: Date: Tue, 30 Nov 2021 12:10:16 +0000
Subject: Bug #81676 [NEW]: Converting string to UTF using \mb_convert_encoding returns empty string
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-238056@lists.php.net to get a copy of this message
From: anton at gamee dot com Operating system: MacOs PHP version: 8.1.0 Package: Unknown/Other Function Bug Type: Bug Bug description:Converting string to UTF using \mb_convert_encoding returns empty string Description: ------------ When using function \mb_convert_encoding() with third parameter \mb_list_encodings() function returns empty string. Test script: --------------- <?php declare(strict_types=1); $string = 'test'; $string = \mb_convert_encoding($string, 'UTF-8', \mb_list_encodings()); echo $string; // '' expecting 'test' Expected result: ---------------- test Actual result: -------------- '' -- Edit bug report at https://bugs.php.net/bug.php?id=81676&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=81676&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=81676&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=81676&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=81676&r=needscript Try newer version: https://bugs.php.net/fix.php?id=81676&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=81676&r=support Expected behavior: https://bugs.php.net/fix.php?id=81676&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=81676&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=81676&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=81676&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=81676&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=81676&r=dst IIS Stability: https://bugs.php.net/fix.php?id=81676&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=81676&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=81676&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=81676&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=81676&r=mysqlcfg

« previous php.bugs (#238056) next »