Re: Unexplained b" and " around message body with python and java, but not with C++

2017-12-22 Thread Alan Conway
A note on the C++ API: std::string or `const char*` will be encoded as an AMQP String (unicode), to encode as AMQP binary use the proton::binary type (which is just a std::vector) . When decoding, you can say e.g. proton::get(msg.body()) which will throws unless the body type is exactly AMQP stri

Re: Unexplained b" and " around message body with python and java, but not with C++

2017-12-22 Thread Gordon Sim
On 22/12/17 08:14, Olivier Delbeke wrote: Hi Chris & all, Your solution (defining the data as unicode) works : [python] sender.send( Message(body="[MESSAGE]") )=> to_string(message.body())=="b"[MESSAGE]"" in C++ at the receiver side [python] sender.send( Message(body=u"[MESSAGE]") ) =>

Re: Unexplained b" and " around message body with python and java, but not with C++

2017-12-22 Thread Olivier Delbeke
will try the u"XXX" tomorrow morning and keep you informed. Best regards, Olivier -----"Chris Richardson" wrote: - >To: "users" >From: "Chris Richardson" >Date: 12/21/2017 06:44PM >Subject: Re: Unexplained b" and " around message

Re: Unexplained b" and " around message body with python and java, but not with C++

2017-12-21 Thread Olivier Delbeke
t; >Date: 12/21/2017 06:44PM >Subject: Re: Unexplained b" and " around message body with python and >java, but not with C++ > >Hi Olivier, > >The 'b' prefix in this case is part of the automatic character >encoding of >the language in use, indicating t

Re: Unexplained b" and " around message body with python and java, but not with C++

2017-12-21 Thread Chris Richardson
Hi Olivier, The 'b' prefix in this case is part of the automatic character encoding of the language in use, indicating that the string is a "bytes" object rather than a Unicode string which is the default expectation of the C++. Have a browse of the relevant character encoding documentation for th

Unexplained b" and " around message body with python and java, but not with C++

2017-12-21 Thread Olivier Delbeke
Hi all, When I send messages to a queue using the java or python APIs, the message body I receive on the other side (C++ binding) is preceded by b" and appended with ". When I send the same message with the C++ API, I do not have this behaviour. Example: [C++] sender.send( proton::message("[ME