Hello, internals!
NikiC wrote very detailed review about my mb_str_split. So i rewrote the
function completely. While i was working on new implementation i've noticed
something in the mbfl library functions: mbfl_substr and mbfl_strlen.


if (encoding->flag & MBFL_ENCTYPE_SBCS) {
len = string->len;
} else if (encoding->flag & (MBFL_ENCTYPE_WCS2BE | MBFL_ENCTYPE_WCS2LE)) {
len = string->len/2;
} else if (encoding->flag & (MBFL_ENCTYPE_WCS4BE | MBFL_ENCTYPE_WCS4LE)) {
len = string->len/4;
}

There is 2 more 2-bytes width encodings: MBFL_ENCTYPE_MWC2BE (UTF16-BE),
MBFL_ENCTYPE_MWC2LE (UTF16-LE).

Is this a mistake or not?

Please check:
https://github.com/php/php-src/blob/30668755b64aa732246d952451f89d1fcfe581f0/ext/mbstring/libmbfl/mbfl/mbfilter.c#L659

Reply via email to