From 3dc77aa47a720a715b78f46b1f9b649c3605c7fd Mon Sep 17 00:00:00 2001 From: Rajith Muditha Attapattu Date: Tue, 1 Dec 2009 04:39:55 +0000 Subject: Added a simple workaround for the python client to handle the "text/plain" content type supplied by the JMS client. The python client expects the encoding along with the content type, while the java client just specifies the content type. The workaround will default to utf8 as the encoding for "text/plan" if the encoding isn't specified. Rafael will provide a more complete solution in the future. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@885667 13f79535-47bb-0310-9956-ffa450edef68 --- python/qpid/messaging.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'python') diff --git a/python/qpid/messaging.py b/python/qpid/messaging.py index c351f0d584..aa01d9ec8c 100644 --- a/python/qpid/messaging.py +++ b/python/qpid/messaging.py @@ -716,6 +716,7 @@ TYPE_MAPPINGS={ dict: "amqp/map", list: "amqp/list", unicode: "text/plain; charset=utf8", + unicode: "text/plain", buffer: None, str: None, None.__class__: None @@ -725,6 +726,7 @@ TYPE_CODEC={ "amqp/map": codec("map"), "amqp/list": codec("list"), "text/plain; charset=utf8": (lambda x: x.encode("utf8"), lambda x: x.decode("utf8")), + "text/plain": (lambda x: x.encode("utf8"), lambda x: x.decode("utf8")), "": (lambda x: x, lambda x: x), None: (lambda x: x, lambda x: x) } -- cgit v1.2.1