Inside of pub.rb, the binary size of the message is taken by doing a .length on the string before it is packed into its array. This means that the header contains the character length of the string, not necessarily its length in bytes.
So, if a value is passed to Pub whose string representation contains multibyte characters, Krakow will report an incorrect size.
Inside of pub.rb, the binary size of the message is taken by doing a
.length
on the string before it is packed into its array. This means that the header contains the character length of the string, not necessarily its length in bytes.So, if a value is passed to Pub whose string representation contains multibyte characters, Krakow will report an incorrect size.
I believe this holds true of other commands (certainly mpub).
Let me know if you'd like me to try and put a PR together for this.