diff --git a/bindings/python/mapnik_datasource.cpp b/bindings/python/mapnik_datasource.cpp index 95c495aec..07383b372 100644 --- a/bindings/python/mapnik_datasource.cpp +++ b/bindings/python/mapnik_datasource.cpp @@ -48,14 +48,26 @@ namespace { //user-friendly wrapper that uses Python dictionary using namespace boost::python; -boost::shared_ptr create_datasource(const dict& d) +boost::shared_ptr create_datasource(dict const& d) { mapnik::parameters params; boost::python::list keys=d.keys(); - for (int i=0; i(keys[i]); object obj = d[key]; + if (PyUnicode_Check(obj.ptr())) + { + PyObject* temp = PyUnicode_AsUTF8String(obj.ptr()); + if (temp) + { + char* c_str = PyString_AsString(temp); + params[key] = std::string(c_str); + Py_DecRef(temp); + } + continue; + } + extract ex0(obj); extract ex1(obj); extract ex2(obj);