Skip to content

Fix GH-23875: Skip gh7980.phpt when windows-1258 is unavailable - #24789

Closed
Truta446 wants to merge 1 commit into
php:PHP-8.4from
Truta446:gh23875-iconv-skip
Closed

Truta446 wants to merge 1 commit into
php:PHP-8.4from
Truta446:gh23875-iconv-skip

Conversation

@Truta446

Copy link
Copy Markdown

Fixes GH-23875.

ext/iconv/tests/gh7980.phpt decodes a windows-1258 MIME header, but that charset is optional in glibc: on Fedora 44 CP1258.so is shipped by glibc-gconv-extra, not by glibc (checked with mdapi.fedoraproject.org), and minimal container images do not install it. iconv_open() then fails and the test reports Wrong encoding, conversion from "???" to "UTF-8" is not allowed instead of skipping.

This adds a SKIPIF that probes the charset with iconv(), the same approach as iconv002.phpt.

Tested on PHP-8.4 (glibc, Ubuntu 24.04): the test still runs and passes when the charset is available; a copy of the test using a nonexistent charset name is skipped with the new reason; ext/iconv/tests passes (78 passed, 0 failed).

The sibling report GH-23874 (bug52211.phpt, CP850, also in glibc-gconv-extra) is already addressed by the rewrite in #24406.

The windows-1258 charset is optional in glibc (on Fedora it ships in
glibc-gconv-extra, which minimal images do not install), so the test fails
with "Wrong encoding" instead of being skipped. Skip it when iconv cannot
open the charset, like iconv002.phpt does for UCS-4LE.
@LamentXU123

Copy link
Copy Markdown
Member

Goof to note that /usr/lib64/gconv/CP1258.so is in https://packages.fedoraproject.org/pkgs/glibc/glibc-gconv-extra/fedora-44-updates.html#files and CP1258 and WINDOWS-1258 are the same encodings so I think this is correct.

@LamentXU123
LamentXU123 requested a review from iliaal October 27, 2026 16:17
thediex pushed a commit to thediex/php-src that referenced this pull request Oct 27, 2026
* PHP-8.4:
  Fix phpGH-23875: Skip gh7980.phpt without windows-1258 (php#24789)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants