-
-
Notifications
You must be signed in to change notification settings - Fork 39
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
With this base image and its derivatives, PHP packages like symfony/string that rely on the php-iconv extension internally still generate wrong output, e.g. when trying to convert Chinese to Ascii.
See https://gitlab.alpinelinux.org/alpine/aports/-/issues/15114 for details and context.
Expected Behavior
Convert strings correctly :-)
I assume that you'll prefer to wait for alpine's php-iconv package to work correctly someday, rather than try & fix this yourself, but at least we have a track of the issue here...
Adding the alpine package icu-data-full fixes the issue (but increases the image size).
Steps To Reproduce
$ composer require symfony/string
$ apk --no-cache add vim # use vim to edit utf-8 files
$ vim test.php
<?php
require_once __DIR__ . '/vendor/autoload.php';
// Sūnzǐ bīngfǎ = Sun Tzu's Art of War in Simplified Chinese
$input = "孙子兵法";
$output = (new \Symfony\Component\String\UnicodeString($input))->ascii();
$expected = "sun zi bing fa";
if ($expected == $output) {
echo "Well done!\n";
} else {
echo "Oops: $output != $expected\n";
}$ php84 test.php
...
$ apk --no-cache add icu-data-full
$ php84 test.php
...
Environment
- OS: alpine 3.22
- How docker service was installed: N/ADocker creation
N/AContainer logs
N/AMetadata
Metadata
Assignees
Labels
Type
Projects
Status