Closed insekticid closed 5 years ago
Fixing a thing by adding a testing channel to the repositories may lead into security issues. Not recommended.
I've checked this issue and the fastest and most solid current solution is indeed the one mentioned above. Since the gnu-libiconv package doesn't depend on too many other packages that might break things or present security issues, it's coming to these Dockerfiles in the following commits... So thanks for reporting these issues.
Even better would be to fix PHP core on its way as well. From my tests, currently it is not possible to properly and conveniently build PHP on Alpine with iconv extension using anything other than musl's iconv implementation (which has very strict view on POSIX standards and lacks the iconv's translit).
In such cases another possible solution is to simply use Linux distribution with glibc such as Debian for base Docker image.
This has now been fixed via a new gnu-libiconv package in the PHP.earth Alpine repository and patched PHP source code. I'll also send a PR to PHP source code, since the PHP iconv extension is not working as it should and doesn't get built when passing libiconv.
tested and it works well
did you sent PR to PHP source code?
I'm still preparing the PR for the php-src. For now, there is only a customized patch added to these builds.
It looks like this issue has been resolved since php-7.x
version.
This issue I think should be closed.
Hello, I'm not sure if this has been directly fixed but I suggest moving this to PHP's side altogether - with the iconv different functionality when using the GNU's libiconv and maybe suggesting some sort of warning in the docs or something else that different iconv libraries or implementations mean also different functionalities... I'm not sure. But in any case closing this one as won't fix or at least a partial fix using custom build of GNU libiconv... Thanks.
I've added this code into one of my custom php:7.3.24-fpm-alpine3.12
docker images and that also did work great.
How to reproduce?
iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', 'šěýčíéáýřčíšýíščř');
How to fix?
RUN apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing gnu-libiconv ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
Thanks
Fixed by installing php7-mbstring
php7-iconv
in that order
RUN apk --no-cache add php7-mbstring php7-iconv
Original solution here: https://github.com/docker-library/php/issues/240#issuecomment-355489551
How to reproduce?
iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', 'šěýčíéáýřčíšýíščř');
How to fix?
refs