Php8-mod-iconv not working when converting from UTF-8 to Windows-1250

php command iconv('UTF-8', 'Windows-1250', $line) prints the error

Warning: iconv(): Wrong encoding, conversion from "UTF-8" to "Windows-1250" is not allowed

while the command

iconv -f UTF-8 -t WINDOWS-1250 utf8.txt > 1250.txt

entered in the terminal works