*/
if ( -1 != grapheme_ascii_check(pstr, size + 1 < str_len ? size + 1 : str_len ) ) {
+ long nsize = ( size < str_len ? size : str_len );
if ( NULL != next ) {
- ZVAL_LONG(next, start+size);
+ ZVAL_LONG(next, start+nsize);
}
- RETURN_STRINGL(((char *)pstr), size, 1);
+ RETURN_STRINGL(((char *)pstr), nsize, 1);
}
/* convert the strings to UTF-16. */
array( "abc", 1, 1, 2, "b" ),
array( "abc", 1, 2, 3, "c" ),
array( "abc", 0, 2, 2, "" ),
-
+ array( "http://news.bbc.co.uk/2/hi/middle_east/7831588.stm", 48, 48 , 50 , "tm" ),
array( $char_a_ring_nfd . "bc", 3, $char_a_ring_nfd . "bc" ),
array( $char_a_ring_nfd . "bc", 2, $char_a_ring_nfd . "b" ),
extract from "abc" "1" graphemes - grapheme_extract starting at byte position 1 with $next = b == b $next=2 == 2
extract from "abc" "1" graphemes - grapheme_extract starting at byte position 2 with $next = c == c $next=3 == 3
extract from "abc" "0" graphemes - grapheme_extract starting at byte position 2 with $next = == $next=2 == 2
+extract from "http%3A%2F%2Fnews.bbc.co.uk%2F2%2Fhi%2Fmiddle_east%2F7831588.stm" "48" graphemes - grapheme_extract starting at byte position 48 with $next = tm == tm $next=50 == 50
extract from "a%CC%8Abc" "3" graphemes - grapheme_extract = a%CC%8Abc == a%CC%8Abc
extract from "a%CC%8Abc" "2" graphemes - grapheme_extract = a%CC%8Ab == a%CC%8Ab
extract from "a%CC%8Abc" "1" graphemes - grapheme_extract = a%CC%8A == a%CC%8A