Skip to content

Commit 0c275e9

Browse files
committed
ext/iconv/tests/bug48147.phpt: skip for non-GNU iconv implementations
This test meaningfully uses the //IGNORE charset suffix that was was a GNU/Solaris extension but is now standardized in POSIX 2024. The way //IGNORE is used, however, is non-standard: POSIX says that //IGNORE will cause untranslatable sequences to be skipped, but this test is expecting it to skip input sequences that are invalid rather than unexpressible in the target charset. That behavior is specific to the two GNU implementations (and was always non-conforming...), so we add a SKIPIF block to ensure that one of the GNU implementations is used.
1 parent df6d745 commit 0c275e9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ext/iconv/tests/bug48147.phpt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
Bug #48147 (iconv with //IGNORE cuts the string)
33
--EXTENSIONS--
44
iconv
5+
--SKIPIF--
6+
<?php
7+
// POSIX 2024 standardizes "//IGNORE", but does NOT say that
8+
// it should ignore invalid input sequences, only untranslatable
9+
// ones. The GNU implementations have however historically skipped
10+
// invalid input sequences when it is used.
11+
if (ICONV_IMPL != "libiconv" && ICONV_IMPL != "glibc") {
12+
die("skip iconv will not //IGNORE invalid input sequences");
13+
}
14+
?>
515
--FILE--
616
<?php
717
$text = "aa\xC3\xC3\xC3\xB8aa";

0 commit comments

Comments
 (0)