Skip to content

ext/iconv/tests/bug48147.phpt: blacklist unknown iconv#22552

Open
orlitzky wants to merge 1 commit into
php:PHP-8.4from
orlitzky:blacklist-iconv-ignore
Open

ext/iconv/tests/bug48147.phpt: blacklist unknown iconv#22552
orlitzky wants to merge 1 commit into
php:PHP-8.4from
orlitzky:blacklist-iconv-ignore

Conversation

@orlitzky

@orlitzky orlitzky commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Fix the last failure in #22413

PHP has ICONV_BROKEN_IGNORE for implementations (glibc) that return an EILSEQ when they //IGNORE an invalid sequence, but some implementations (musl) don't support //IGNORE at all. We blacklist those implementations in the test since //IGNORE is now part of the standard (not supporting it is "bad"), but there is nothing PHP can do about it.

Whatever libc does ultimately has to be OK. I think this needs better documentation (php/doc-en#5646) rather than more code.

We should probably be blacklisting BSD and IBM iconv as well, but I don't have them available to test.

This test is for the behavior of iconv's magic "//IGNORE" suffix. The
output it expects appears to agree with POSIX 2024 even when the
underlying implementation (glibc) does not. A comment has been added
to this effect, and two calls to urlencode() have been removed so that
two (expected) errors are not swallowed.

Afterwards we blacklist the "unknown" ICONV_IMPL, with musl in mind.
Despite what POSIX says, support for //IGNORE is far from standard. We
are checking for morally-correct results, however, so we opt for a
blacklist rather than a whitelist of implementations.
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.

1 participant