moriyoshi Sat Jan 31 22:03:15 2004 EDT
Added files:
/php-src/ext/pcre/tests bug27103.phpt
Log:
- Forgot to add test case.
http://cvs.php.net/co.php/php-src/ext/pcre/tests/bug27103.phpt?r=1.1&p=1
Index: php-src/ext/pcre/tests/bug27103.phpt
+++ php-src/ext/pcre/tests/bug27103.phpt
--TEST--
Bug #27103 (preg_split('//u') incorrectly splits UTF-8 strings into octets)
--FILE--
<?php
function iter($ar)
{
foreach ($ar as $c) {
echo htmlentities($c, 0, "UTF-8"), ": ", strlen($c), "\n";
}
}
$teststr = "\xe2\x82\xac hi there";
iter(preg_split('//u', $teststr, -1, PREG_SPLIT_NO_EMPTY));
preg_match_all('/./u', $teststr, $matches);
iter($matches[0]);
?>
--EXPECT--
€: 3
: 1
h: 1
i: 1
: 1
t: 1
h: 1
e: 1
r: 1
e: 1
€: 3
: 1
h: 1
i: 1
: 1
t: 1
h: 1
e: 1
r: 1
e: 1
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php