Bug #80671 [NEW]: mb_convert_encoding() throws ValueError unexpectedly

From: Date: Tue, 26 Jan 2021 07:37:41 +0000
Subject: Bug #80671 [NEW]: mb_convert_encoding() throws ValueError unexpectedly
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231775@lists.php.net to get a copy of this message
From: alec at alec dot pl Operating system: PHP version: 8.0.1 Package: mbstring related Bug Type: Bug Bug description:mb_convert_encoding() throws ValueError unexpectedly Description: ------------ PHP Fatal error: Uncaught ValueError: mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "WINDOWS-1253". Before PHP8 it never threw even a warning, so to me it looks like a BC break which: 1. should throw a warning in PHP 8.0, before it could switch to a fatal error in 8.1. 2. should be mentioned in the migration guide and the documentation. Reference: https://github.com/roundcube/roundcubemail/issues/7850 Test script: --------------- <?php mb_convert_encoding("test", "UTF-8", "WINDOWS-1253"); -- Edit bug report at https://bugs.php.net/bug.php?id=80671&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=80671&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=80671&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=80671&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=80671&r=needscript Try newer version: https://bugs.php.net/fix.php?id=80671&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=80671&r=support Expected behavior: https://bugs.php.net/fix.php?id=80671&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=80671&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=80671&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=80671&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=80671&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=80671&r=dst IIS Stability: https://bugs.php.net/fix.php?id=80671&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=80671&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=80671&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=80671&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=80671&r=mysqlcfg

« previous php.bugs (#231775) next »