xref: /PHP-8.2/ext/iconv/tests/bug74230.phpt (revision 1eaaabca)
1--TEST--
2Bug #74230 iconv fails to fail on surrogates
3--EXTENSIONS--
4iconv
5--FILE--
6<?php
7
8$high = "\xED\xa1\x92"; // codepoint D852
9$low = "\xED\xBD\xA2"; // codepoint DF62
10$pair = $high.$low;
11var_dump(
12    @\iconv('UTF-8', 'UTF-8', $high) === false,
13    @\iconv('UTF-8', 'UTF-8', $low) === false,
14    @\iconv('UTF-8', 'UTF-8', $pair) === false
15);
16
17?>
18--EXPECT--
19bool(true)
20bool(true)
21bool(true)
22