polyfill icon indicating copy to clipboard operation
polyfill copied to clipboard

iconv(): Wrong encoding, conversion from "ASCII" to "UTF-8//IGNORE" is not allowed

Open danielmarschall opened this issue 3 years ago • 2 comments

Hello,

I noticed that there is an incompatibility with the mbstring polyfill and PHP 8.1 / Alpine Linux, which breaks a lot of my projects as soon as the php81-mbstring is not installed, but php81-iconv is installed:

Example:

Warning: iconv(): Wrong encoding, conversion from "ASCII" to "UTF-8//IGNORE" is not allowed in phar:///var/www/localhost/htdocs/phpstan.phar/vendor/symfony/polyfill-mbstring/Mbstring.php on line 736

It looks like //IGNORE is not accepted since echo iconv('UTF-8', 'UTF-8', 'test'); works, while echo iconv('UTF-8', 'UTF-8//IGNORE', 'test'); doesn't

danielmarschall avatar Jan 07 '22 00:01 danielmarschall

iconv on Alpine is really broken. You should consider installing ext-mbstring.

derrabus avatar Jan 07 '22 00:01 derrabus

See also: docker-library/php#240

jdreesen avatar Jan 07 '22 08:01 jdreesen