Skip to content

Skip ISO-2022-JP tests on unknown libc#22415

Open
orlitzky wants to merge 2 commits into
php:PHP-8.4from
orlitzky:skip-iso-2022-jp-unknown
Open

Skip ISO-2022-JP tests on unknown libc#22415
orlitzky wants to merge 2 commits into
php:PHP-8.4from
orlitzky:skip-iso-2022-jp-unknown

Conversation

@orlitzky

Copy link
Copy Markdown
Contributor

Fixes two failures in #22413.

The ISO-2022-JP encoding is stateful, so there is no single "right answer" in these tests. Musl ("unknown") uses a less-efficient encoding that makes the tests fail. To fix it, we can just skip these tests on unknown libc, since in that case we can't expect the expected output.

Cherry-picked from #16840

orlitzky added 2 commits June 23, 2026 10:23
This test does a byte comparison of the expected ISO-2022-JP encoding
with the result of iconv(). The ISO-2022-JP encoding, however, is
stateful; there are many ways to arrive at a correct answer. Musl is
known to have an inefficient encoding that causes it to fail this
test, so we add a SKIPIF for the "unknown" iconv implementation that
musl has.

Nothing is wrong here per se, but to support the musl output (and that
of other iconvs), an expert would need to verify it.
This test checks the output of iconv_mime_encode() with a target
charset of ISO-2022-JP. That charset is stateful, though, and there
are many ways to arrive at a correct answer. Musl has an inefficient
encoding of it that causes this to fail because the actual output
differs from (and is much longer than) the expected output. We add a
SKIPIF for the "unknown" iconv implementation that musl has.
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.

2 participants