bug74230.phpt 397 B

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