On 05/06/2010 04:39 PM, Rafael Schloming wrote:
Jonathan Robie wrote:
Java, C++, and Python each have a different understanding of what a
string is, what a character is, and how they approach Unicode.

If I place a string or a character in a map using one language, and
read it back in another language, what do I get for each language?
Does this depend at all on the platform?

In maps, do these types round-trip? Suppose a sender creates a char or
a string, and sends it to a client in another language, then the
receiver reads it and sends it back. Can the original sender compare
the string it sent to the one it received and expect it to always be
equal?

This won't work with characters since python doesn't have a character
type. Any characters will come out as 1 character long unicode strings,
which means when you read them back you'll get a unicode string rather
than a character.

In general if you stick to the "unicode" type in python and the "String"
type in Java you should be able to safely round-trip between the two. I
don't know how this will interact with the C++ map message API. I know
at one point unicode inside a map would come out as raw bytes on the C++
side, however I don't know if this is still true.


All strings handled by qpid in c++ are raw bytes. Qpid libraries do not gratuitously modify strings for unicode or any other reasons. Applications may chose to use UTF-8 or any other encoding they like, the qpid libs are neutral.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to