[rabbitmq-discuss] Decoding header fields
tonygarnockjones+rabbitmq at gmail.com
Thu Aug 2 14:39:43 BST 2012
On 2 August 2012 09:25, Bernhard Mogens Ege <bme at saseco.dk> wrote:
> Hmm looking at WireFormatting.cs, UTF8 is already assumed when converting a
> string to byte. Why not assume UTF8
> when receiving the byte and return a string instead of a byte
> method: ReadLongstr)?
Because not all bytes are valid UTF-8, AMQP doesn't provide a way of
giving an interpretation for a particular byte vector, and it'd be Bad to
not support transmission of arbitrary binary content over AMQP.
The table writer can cope with Strings by using UTF-8 encoding as a
convenience because C# has given the table writer enough to work with: it
can distinguish bytes from Strings. This doesn't hold in the other
direction. The table reader would have to guess.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss