Open chriskl opened 10 years ago
Actually, strlen is used all through the Queue code.
Plain strlen() just counts bytes, the header must be bytes.
We have setup PHP to replace all strlen calls with calls to mb_strlen
IMHO the wrong way to approach the problem.
@chriskl, @croensch Any ideas to solve the problem?
I'v used mb_strlen($utf8string, '8bit')
before, which takes the string regardless of encoding and counts every 8 bits (so a byte).
I was just reviewing the API and code for using ActiveMQ from ZF and I saw this line in the Activemq Queue adapter:
$frame->setHeader('content-length', strlen($message));
We intend to send utf-8 messages. Surely the strlen calculation here must instead by a careful 8-bit byte count. According to the spec, this must be bytes, not characters.
We have setup PHP to replace all strlen calls with calls to mb_strlen