eventmachine/eventmachine — pull request #315 by tjsingleton (2012-04-16 20:29:04+00:00)
Title: Stomp content-length header should be in bytes

In 1.9.x String#size doesn't return the number of bytes, but the number of characters. The Stomp protocol wants the number of bytes in the content-length header. Using String#size falls down when there are multibyte characters. I updated the header to use bytesize when it's available matching the form in [EM::Connection#send_data](https://github.com/eventmachine/eventmachine/blob/master/lib/em/connection.rb#L324).

> It is recommended that SEND frames include a content-length header which is a byte count for the length of the message body."
>
> http://docs.codehaus.org/display/STOMP/Protocol

I wasn't sure the best way to write a test for it. I'd be happy to update the test if given advice.