Hi all,

I am working on one of the Http_Client bugs, ZF-2098, which describes a
problem the Http_Client has when sending multi-byte encoded (eg. UTF8
Chinese) text in the request body when mbstring is loaded and overloads
the strlen() function. This happens because I've been using strlen() to
calculate the body size (in bytes - not in characters). 

This works in most cases, but when mbstring overloads strlen with
mb_strlen - what you get is the string length in characters and not in
bytes. 

Brian DeShong already proposed a patch fixing the problem, but I've
found that there are several Zend_Http classes that suffer from the same
problem. I'm sure that other ZF classes, as well as users, who need a
transparent way to calculate string length in bytes, irregardless of
loaded extensions or PHP version (no idea what PHP 6 / 5.3 would cause
in this case). 

So, is there any component of the framework where you would see a
static ::strByteLength($string) method? I was going to implement one in
Zend_Http_Client - but it's not really Zend_Http_Client specific. 

Suggestions welcome ;)

Shahar.

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to