Uses bytesize to determine string length in encoder rather than length.
Uses bytesize to determine string length in encoder rather than length.

The length function on Ruby 1.9 Strings returns the number of characters rather than the number of bytes.  Ruby 1.8 and 1.9 Strings both have a bytesize function that returns the number of bytes.  This makes the encoder use bytesize.

It should fix decoding errors on UTF-8 strings that contain multi-byte characters.

codekitchen/ruby-protocol-buffers,crashlytics/ruby-protocol-buffers,nexiahome/ruby-protocol-buffers,retailnext/ruby-protocol-buffers