Skip to content

Commit 2f97c3e

Browse files
committed
ext/iconv/tests/bug76249.phpt: drop //IGNORE suffix
This test performs a conversion from UCS-2 to UTF-8 using iconv and stream filters, with the suffix "//IGNORE" being added to the target charset. This magic //IGNORE string was recently standardized in POSIX 2024, but it is not yet portable: musl for example will simply fail when it encounters //IGNORE in what is supposed to be a charset name. Fortunately, we do not need to think too hard about the general problem here: the input is "abc", which has no un-translatable sequences. We can simply drop the "//IGNORE".
1 parent 9098d15 commit 2f97c3e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/iconv/tests/bug76249.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ iconv
77
$fh = fopen('php://memory', 'rw');
88
fwrite($fh, "abc");
99
rewind($fh);
10-
if (false === @stream_filter_append($fh, 'convert.iconv.ucs-2/utf8//IGNORE', STREAM_FILTER_READ, [])) {
11-
stream_filter_append($fh, 'convert.iconv.ucs-2/utf-8//IGNORE', STREAM_FILTER_READ, []);
10+
if (false === @stream_filter_append($fh, 'convert.iconv.ucs-2/utf8', STREAM_FILTER_READ, [])) {
11+
stream_filter_append($fh, 'convert.iconv.ucs-2/utf-8', STREAM_FILTER_READ, []);
1212
}
1313
var_dump(stream_get_contents($fh));
1414
?>
1515
DONE
1616
--EXPECTF--
17-
Warning: stream_get_contents(): iconv stream filter ("ucs-2"=>"utf%A8//IGNORE"): invalid multibyte sequence in %sbug76249.php on line %d
17+
Warning: stream_get_contents(): iconv stream filter ("ucs-2"=>"utf%A8"): invalid multibyte sequence in %sbug76249.php on line %d
1818
string(0) ""
1919
DONE

0 commit comments

Comments
 (0)