You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Kerry Bonin <ke...@gmail.com> on 2010/06/09 20:01:22 UTC

Best practice for sending UTF-16 wstring and Binary blobs via messaging API for C++ & Python ?

Is the recommended practice for sending a UTF-16 string to convert to
UTF-8 and send as std::string?  Ideally, is there an example available
to send & receive a wstring via the messaging API?  I understand the
amqp 0-10 codec supports this type, but its not clear how to send
something not directly supported by the Variant class.

On a related note, what is the recommended practice for sending a
binary blob using the messaging API?  It wasn't clear from QPID-2452
if it is safe to stuff a binary array into a string type.  Is there
any example available to send & receive a binary blob via the
messaging API?

And my apologies if this has appeared in recent example code, I'm
using a slightly dated trunk...

Thanks!

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Best practice for sending UTF-16 wstring and Binary blobs via messaging API for C++ & Python ?

Posted by Gordon Sim <gs...@redhat.com>.
On 06/09/2010 07:01 PM, Kerry Bonin wrote:
> Is the recommended practice for sending a UTF-16 string to convert to
> UTF-8 and send as std::string?  Ideally, is there an example available
> to send&  receive a wstring via the messaging API?  I understand the
> amqp 0-10 codec supports this type, but its not clear how to send
> something not directly supported by the Variant class.
>
> On a related note, what is the recommended practice for sending a
> binary blob using the messaging API?  It wasn't clear from QPID-2452
> if it is safe to stuff a binary array into a string type.  Is there
> any example available to send&  receive a binary blob via the
> messaging API?

The string Variant type can hold anything a std::string can, so binary 
is fine. You can signal any encoding via Variant::setEncoding() (if no 
encoding is specified the string will be transferred as an AMQP vbin16). 
There is no special wide string support as yet.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org