summaryrefslogtreecommitdiff
path: root/python/qpid/messaging.py
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2009-12-01 04:39:55 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2009-12-01 04:39:55 +0000
commit3dc77aa47a720a715b78f46b1f9b649c3605c7fd (patch)
tree237378da814ed9f6c71146b9c67d336aa19f28c5 /python/qpid/messaging.py
parentab4f5a70d1b6a0e00cb5bbc9edc1d3215e77cf5d (diff)
downloadqpid-python-3dc77aa47a720a715b78f46b1f9b649c3605c7fd.tar.gz
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
Diffstat (limited to 'python/qpid/messaging.py')
-rw-r--r--python/qpid/messaging.py2
1 files changed, 2 insertions, 0 deletions
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)
}