-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
Strings::webalize() returns an empty string on Alpine Linux #109
Comments
Can you inspect it or try to find solution? Related #107 |
There is no transliteration support at all. |
I guess your best luck would be by installing php-intl, will that help? |
List of all installed modules, including intl
@dg possible solution https://github.com/symfony/polyfill-iconv |
I think there is not problem in Nette but in Alpine Linux. For me these steps worked:
|
Have you reported it to upstream? |
It triggers E_NOTICE so it is IMHO ok, or not? |
I think E_NOTICE is ok. |
@dg In my opinion it is not ok. On localhost it works fine for me because I've glibc iconv. However in docker it doesn't. Obviously docker has production settings so nobody knew about the E_NOTICE. In my opinion we should fallback to Alternatively we could use Also Leaving it as is means that I can't use toAscii or webalize anywhere in my application and have to check all 3rd party libraries that they don't use them either. And that is really not ok. |
@enumag It's not a Docker issue, it's just an issue with the Alpine image. Use different base image that is not intentionally light and missing essential features. |
@Majkl578 Well Nette already has some workaround for glibc, there is no reason for it to not have another workaround for musl (which is used in alpine) if such workaround is possible. If it is not possible I'd expect an exception that musl implementation of iconv is not supported by Nette instead of just E_NOTICE and this should be checked by Nette requirements checker as well. Returning completely wrong values with just a notice is a bug in my opinion. |
I've never heard of a thing called musl until now and as far as I know there's barely any Linux distro that uses it. I'd be just fine with calling it unsupported (at least for now). |
Alpine is used quite often to have docker images small. Even if musl is used by Alpine alone it is enough to introduce some support for it or at least throw a proper exception. |
@enumag I found a solutions for this problem with iconv //TRANSLIT and //IGNORE flags. You just build php-iconv extension with GNU libiconv. You can see it in this Dockerfile. I tried it today with php 7.0.19 and it works like a charm. |
@plispe Thanks but I'm well aware of that solution. My point is this workaround should not be needed or there should be an exception to let me know there is something wrong. Current solution with silent error is insufficient for a library like Nette. |
@enumag so send PR. |
@dg fyi, having you react and confirm sending a PR won't be a waste of time (and won't be rejected right away because of the idea, not wrong implementation) is really helpful. |
@enumag sure, I understand your argument and I agree, that Nette should throw an exception in this case. With my solution(workaround), you can use //TRANSLITERATE and //IGNORE Iconv flags on alpine linux, but it should not be needed in this case. |
I tried but unfortunately I don't know what to use instead of Also does anyone know what other implementations of iconv are out there? |
I think this is due to musl implementation of iconv.
The text was updated successfully, but these errors were encountered: