com php-src: add test for bug #74230: ext/intl/tests/bug74230.phpt

[email protected] (Anatol Belski)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    6da475367a9932147a0adc3c5ed7a9d9e26f011a
Author:    Anatol Belski <[email protected]>         Mon, 27 Mar 2017 19:33:51 +0200
Parents:   1f8fc0fb5618af498fd55f7c594ef9ff4b8013d9
Branches:  PHP-7.0 PHP-7.1 master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=6da475367a9932147a0adc3c5ed7a9d9e26f011a

Log:
add test for bug #74230

Bugs:
https://bugs.php.net/74230

Changed paths:
  A  ext/intl/tests/bug74230.phpt


Diff:
diff --git a/ext/intl/tests/bug74230.phpt b/ext/intl/tests/bug74230.phpt
new file mode 100644
index 0000000..70ef6ae
--- /dev/null
+++ b/ext/intl/tests/bug74230.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #74230 iconv fails to fail on surrogates
+--SKIPIF--
+<?php if(!extension_loaded('iconv')) print 'skip'; ?>
+--FILE--
+<?php
+
+$high = "\xED\xa1\x92"; // codepoint D852
+$low = "\xED\xBD\xA2"; // codepoint DF62
+$pair = $high.$low;
+var_dump(
+    @\iconv('UTF-8', 'UTF-8', $high) === false,
+    @\iconv('UTF-8', 'UTF-8', $low) === false,
+    @\iconv('UTF-8', 'UTF-8', $pair) === false
+);
+
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(true)
+
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.