php-iconv issue
#1
Tue, 2015-11-17 14:54
studna
-
- Offline
- 1 year 8 months ago
- 2015-11-17
Hi. I am trying to build some Docker image based on alpine linux. Everything works fine, but iconv do not.
$ apk update && apk add php-cli php-iconv $ php -i | grep iconv iconv iconv support => enabled iconv implementation => unknown iconv library version => unknown iconv.input_encoding => no value => no value iconv.internal_encoding => no value => no value iconv.output_encoding => no value => no value
<?php // test.php $text = "This is the Euro symbol '...'."; echo 'Original : ', $text, PHP_EOL; echo 'TRANSLIT : ', iconv("UTF-8", "ISO-8859-1//TRANSLIT", $text), PHP_EOL; echo 'IGNORE : ', iconv("UTF-8", "ISO-8859-1//IGNORE", $text), PHP_EOL; echo 'Plain : ', iconv("UTF-8", "ISO-8859-1", $text), PHP_EOL;
$ php test.php Original : This is the Euro symbol '€'. TRANSLIT : PHP Notice: iconv(): Wrong charset, conversion from `UTF-8' to `ISO-8859-1//TRANSLIT' is not allowed in /tmp/test.php on line 8 IGNORE : PHP Notice: iconv(): Wrong charset, conversion from `UTF-8' to `ISO-8859-1//IGNORE' is not allowed in /tmp/test.php on line 9 Plain : This is the Euro symbol '*'.
I also tried some others Docker images, but it seems it did not work either. Many thanks for any help.
Hello. Have you tried this one - https://hub.docker.com/r/orukami/alpine-php/ ?
It build with libiconv instead of standart iconv.
The only problem i had with it it's an error then i tried to compile libiconv.
Quoted from here: https://github.com/mxe/mxe/issues/204
This patch helped - https://github.com/mxe/mxe/blob/7e231efd245996b886b501dad780761205ecf376/src/libiconv-1-fixes.patch