summaryrefslogtreecommitdiff
path: root/qpid/cpp/include
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/cpp/include')
-rw-r--r--qpid/cpp/include/qpid/messaging/Message.h1
-rw-r--r--qpid/cpp/include/qpid/swig_python_typemaps.i10
2 files changed, 10 insertions, 1 deletions
diff --git a/qpid/cpp/include/qpid/messaging/Message.h b/qpid/cpp/include/qpid/messaging/Message.h
index 10569eb006..6315d3e86f 100644
--- a/qpid/cpp/include/qpid/messaging/Message.h
+++ b/qpid/cpp/include/qpid/messaging/Message.h
@@ -149,6 +149,7 @@ class QPID_MESSAGING_CLASS_EXTERN Message
*/
QPID_MESSAGING_EXTERN const qpid::types::Variant::Map& getProperties() const;
QPID_MESSAGING_EXTERN qpid::types::Variant::Map& getProperties();
+ QPID_MESSAGING_EXTERN void setProperties(const qpid::types::Variant::Map&);
/**
* Set the content to the data held in the string parameter. Note:
diff --git a/qpid/cpp/include/qpid/swig_python_typemaps.i b/qpid/cpp/include/qpid/swig_python_typemaps.i
index 25a4e46b18..ef32012693 100644
--- a/qpid/cpp/include/qpid/swig_python_typemaps.i
+++ b/qpid/cpp/include/qpid/swig_python_typemaps.i
@@ -61,6 +61,11 @@ typedef int Py_ssize_t;
if (PyInt_Check(value)) return qpid::types::Variant(int64_t(PyInt_AS_LONG(value)));
if (PyLong_Check(value)) return qpid::types::Variant(int64_t(PyLong_AsLongLong(value)));
if (PyString_Check(value)) return qpid::types::Variant(std::string(PyString_AS_STRING(value)));
+ if (PyUnicode_Check(value)) {
+ qpid::types::Variant v(std::string(PyUnicode_AS_DATA(value)));
+ v.setEncoding("utf8");
+ return v;
+ }
if (PyDict_Check(value)) {
qpid::types::Variant::Map map;
PyToMap(value, &map);
@@ -116,7 +121,10 @@ typedef int Py_ssize_t;
}
case qpid::types::VAR_STRING : {
const std::string val(v->asString());
- result = PyString_FromStringAndSize(val.c_str(), val.size());
+ if (v->getEncoding() == "utf8")
+ result = PyUnicode_FromStringAndSize(val.c_str(), val.size());
+ else
+ result = PyString_FromStringAndSize(val.c_str(), val.size());
break;
}
case qpid::types::VAR_MAP : {