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

Unexpected issue while trying to use iconv #214

Closed
jonasraoni opened this issue Apr 16, 2022 · 6 comments
Closed

Unexpected issue while trying to use iconv #214

jonasraoni opened this issue Apr 16, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@jonasraoni
Copy link

I've tried to execute the following code against the image pkpofficial/ojs:3_3_0-10:

echo iconv('ISO-8859-1', 'UTF-8', 'test'); //works
echo iconv('ISO-8859-1', 'UTF-8//IGNORE', 'test'); //fails, but shouldn't

And it failed, perhaps this might be helpful to address it: docker-library/php#240 (comment)

Origin: pkp/pkp-lib#7765

@marcbria
Copy link
Collaborator

Thanks a lot for the digging and for pointing the fix.
I will save some time to modify the images next week or so.

@jonasraoni
Copy link
Author

Good luck! :)
FYI here I'm using a ready PHP image (FROM php:8.0-apache), which is working fine.

@marcbria
Copy link
Collaborator

It needs to be. :-)

Your image is based on Debian and this is good for development (because it includes a lot of stuff) but I feel is better to keep production images over alpine (less is more).

Alpine images are tiny and this means less vulnerability risks and better transfer/management.

But this is just my opinion and I feel this is the kind of decision we need to be taken collectively, for instance in the RFC issue open in #159.

Thanks for the tip,
m.

@jonasraoni
Copy link
Author

I agree, that's the way to go, neat and small 🥰
I just left the image that I'm using as a possible reference to solve the problem with iconv.

@marcbria
Copy link
Collaborator

marcbria commented Jun 8, 2022

Issue happens because the library was moved in alpine.
It will be automatically fixed if we move (one day) to debian-slim.

Adding this to the docker file is supposed to work:

RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.12/community/ gnu-libiconv=1.15-r2
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so

Source: docker-library/php#240 (comment)

New 3.3.0-11 is built with this but not tested yet.

@jonasraoni
Copy link
Author

This will fade away, as you're moving to Debian, so I'm closing this one 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants