Hi,
some time ago I got very strange error while sending a message:
Internal error (116 bytes written instead of 106 bytes) (999)
The cause is here:
strlen($aMessage['BINARY_NOTIFICATION']); // 106
@fwrite($this->_hSocket, $aMessage['BINARY_NOTIFICATION']); // 116
strlen counts correctly number of bytes also when multibyte character
set is used.
However php mbstring extension comes with nice backstabbing feature
called mbstring.func_overload.
http://php.net/manual/en/mbstring.overload.php
When this is active, strlen actually returns number of *characters*
there are two suggestions how to avoid it.First one seems shorter but
it includes string conversion.
http://php.net/manual/en/function.strlen.php#54906 (bartek at
proteus,pl 19-Jul-2005 05:08)
http://www.php.net/manual/en/function.strlen.php#72274 (paolo dot
mosna at gmail dot com 10-Jan-2007 07:58)
I would appreciate if you find time to integrate correct byte counting
also for this php setting, because i can not turn it off.
Thank you very much,
Roman