cakephp/cakephp — comment on commit 176da154172c9d7670086ad4dc25733e03912bec
File: cake/libs/http_response.php line 229
By challet:

Since the *$chunkLength* value is a number of bytes (as specified in the [RFC](http://tools.ietf.org/html/rfc2616#section-3.6.1) : "chunk-data = chunk-size(OCTET)"), the use of **substr** could lead to extract some extra bytes and broke the decoding :

__Testing case :__
* [mbstring.func_overload](http://fr.php.net/manual/en/mbstring.overload.php) & 2 == 2 (internally replace *substr* to *mb_substr*)
* the *$body* variable contains at least one multibyte character (*é* for instance).

I would suggest the use of [**mb_strcut**](http://fr.php.net/manual/en/function.mb-strcut.php) (*[...] operates on bytes instead of characters.*) as a replacement.

__Note :__ This is a very specific situation. Since the basic **strlen** (without overloading) works as "1 byte == 1 character", it would still works for multi-bytes string. The suggestion given fix for the spcific case without to broke the general one.