On 2 August 2012 09:25, Bernhard Mogens Ege <span dir="ltr">&lt;<a href="mailto:bme@saseco.dk" target="_blank">bme@saseco.dk</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hmm looking at WireFormatting.cs, UTF8 is already assumed when converting a<br>
string to byte[]. Why not assume UTF8<br>
when receiving the byte[] and return a string instead of a byte[] (offending<br>
method: ReadLongstr)?<br></blockquote><div><br>Because not all byte[]s are valid UTF-8, AMQP doesn&#39;t provide a way of giving an interpretation for a particular byte vector, and it&#39;d be Bad to not support transmission of arbitrary binary content over AMQP.<br>
<br>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 byte[]s from Strings. This doesn&#39;t hold in the other direction. The table reader would have to guess.<br>
<br>Regards,<br>  Tony<br><br>
</div></div>