summaryrefslogtreecommitdiff
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
commitbeffd788a95c09728bd47a5e2f39844d3f9b3e8b (patch)
tree699c3c5bb405de262987caea330316a1eb859c97
parent7a918b918eb9e10c365eb27b728a2aad229fd768 (diff)
downloadqpid-python-beffd788a95c09728bd47a5e2f39844d3f9b3e8b.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@885667 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/python/qpid/messaging.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/qpid/python/qpid/messaging.py b/qpid/python/qpid/messaging.py
index c351f0d584..aa01d9ec8c 100644
--- a/qpid/python/qpid/messaging.py
+++ b/qpid/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)
}