php-src/ext/mbstring
Alex Dowad c211e67b4e Remove XFAIL from test cases for mb_strcut when used with JIS or ISO-2022-JP encoding
The documentation for mb_strcut states:

    mb_strcut(
        string $string,
        int $start,
        ?int $length = null,
        ?string $encoding = null
    ): string

    mb_strcut() extracts a substring from a string similarly to mb_substr(),
    but operates on bytes instead of characters. If the cut position happens
    to be between two bytes of a multi-byte character, the cut is performed
    starting from the first byte of that character.

My understanding of the $length parameter for mb_strcut is that it
specified the range of bytes to extract from $string, and that all
characters encoded by those bytes should be included in the returned
string, even if that means the returned string would be longer than
$length bytes. This can happen either if 1) there is more than one way
to encode the same character in $encoding, and one way requires more
bytes than the other, or 2) $encoding uses escape sequences.

However, discussion with users of mb_strcut indicates that many of them
interpret $length as the maximum length of the *returned* string.
This is also the historical behavior of the function.

Hence, there is no need to modify the behavior of mb_strcut and then
remove XFAIL from these test cases afterwards. We can keep the current
behavior.
2023-04-02 13:52:14 +02:00
..
libmbfl For UTF-7, emit error marker if Base64 section ends abruptly after first half of surrogate pair 2023-03-27 11:34:11 +02:00
tests Remove XFAIL from test cases for mb_strcut when used with JIS or ISO-2022-JP encoding 2023-04-02 13:52:14 +02:00
ucgendat Optimize mb_str{,im}width for performance 2021-09-29 18:19:01 +02:00
common_codepoints.txt Improve mb_detect_encoding's recognition of Turkish text 2022-12-30 14:22:46 +02:00
config.m4 Move mobile variants of SJIS into mbfilter_sjis.c 2022-12-12 16:28:49 +02:00
config.w32 Move mobile variants of SJIS into mbfilter_sjis.c 2022-12-12 16:28:49 +02:00
CREDITS
gen_rare_cp_bitvec.php Mark globals as const (#10303) 2023-01-23 13:46:58 +00:00
mb_gpc.c Remove unused 'to_language' and 'from_language' struct fields 2022-08-16 16:43:26 +02:00
mb_gpc.h Remove unused 'to_language' and 'from_language' struct fields 2022-08-16 16:43:26 +02:00
mbstring.c Fix compile error in Windows CI job caused by 0779950768 2023-03-25 06:02:01 +02:00
mbstring.h Implement mb_output_handler using fast text conversion filters 2023-01-03 09:02:21 +02:00
mbstring.stub.php Fix mb_strimwidth RC info 2022-08-05 17:06:23 +02:00
mbstring_arginfo.h Do not generate CONST_CS when registering constants (#9439) 2022-08-28 08:27:19 +02:00
php_mbregex.c Reduce memory allocated by var_export, json_encode, serialize, and other (#8902) 2022-07-08 14:47:46 +02:00
php_mbregex.h Declare ext/mbstring constants in stubs (#8798) 2022-06-23 17:34:08 +02:00
php_onig_compat.h
php_unicode.c Implement conditional casing for Greek letter sigma when title-casing text 2023-01-12 17:41:11 +02:00
php_unicode.h Speed boost for mb_stripos (when not using UTF-8) 2022-12-18 15:31:20 +02:00
rare_cp_bitvec.h Mark globals as const (#10303) 2023-01-23 13:46:58 +00:00
unicode_data.h Update Unicode tables to 14.0.0 2021-09-20 09:58:20 +02:00