Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iconv problem #24

Open
prolic opened this issue Aug 2, 2018 · 6 comments
Open

Iconv problem #24

prolic opened this issue Aug 2, 2018 · 6 comments
Assignees

Comments

@prolic
Copy link
Member

prolic commented Aug 2, 2018

Test-Case:
php -d error_reporting=22527 -d display_errors=1 -r 'var_dump(iconv("UTF-8", "UTF-8//IGNORE", "This is the Euro symbol '\''€'\''."));'

output:
Notice: iconv(): Wrong charset, conversion from UTF-8' to UTF-8//IGNORE' is not allowed in Command line code on line 1

So I customized the dockerfile to:

FROM prooph/php:7.1-fpm-opcache
RUN apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php

Let's test this:

output:
string(30) "This is the Euro symbol '€'."

@sandrokeil
Copy link
Member

I think the LD_PRELOAD fix is not a good solution for our prooph Docker images. Maybe mb_convert_encoding($text, 'UTF-8', 'UTF-8'); does the same if you want to remove invalid UTF-8 characters?

@prolic
Copy link
Member Author

prolic commented Aug 2, 2018 via email

@prolic
Copy link
Member Author

prolic commented Aug 3, 2018

I checked again, the iconv stuff is used by wordpress.

@sandrokeil
Copy link
Member

Ok but I don't know how to solve this and I think it's not related for our Docker images, because they are only intended for development and may be only a blueprint for production.

@prolic
Copy link
Member Author

prolic commented Aug 3, 2018 via email

@sandrokeil
Copy link
Member

Maybe this is solved in the new Docker images >= PHP 7.4 with Alpine 3.15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants