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

From: Date: Tue, 26 Jan 2021 07:39:25 +0000
Subject: Bug #80671 [Opn]: mb_convert_encoding() throws ValueError unexpectedly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231776@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80671&edit=1 ID: 80671 User updated by: alec at alec dot pl Reported by: alec at alec dot pl Summary: mb_convert_encoding() throws ValueError unexpectedly Status: Open Type: Bug Package: mbstring related PHP Version: 8.0.1 Block user comment: N Private report: N New Comment: BTW, regarding the error message, the encoding is not invalid, it is unsupported. Previous Comments: ------------------------------------------------------------------------ [2021-01-26 07:37:41] alec at alec dot pl 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 this bug report at https://bugs.php.net/bug.php?id=80671&edit=1

« previous php.bugs (#231776) next »