if (PyUnicode_Check(o))
{
Py_ssize_t size;
- char *ptr = PyUnicode_AsUTF8AndSize(o, &size);
+ const char *ptr = PyUnicode_AsUTF8AndSize(o, &size);
if (!ptr)
throw YACS::ENGINE::ConversionException("Conversion from PyUnicode to string failed");
s.assign(ptr, size);
// the objref is used by Python as a string (prefix:value) keep it as a string
Py_ssize_t size;
std::string s;
- char *ptr = PyUnicode_AsUTF8AndSize(o, &size);
+ const char *ptr = (char*) PyUnicode_AsUTF8AndSize(o, &size);
if (!ptr)
throw YACS::ENGINE::ConversionException("Conversion from PyUnicode to string failed");
s.assign(ptr, size);
}
Py_ssize_t size;
std::string mystr;
- char *ptr = PyUnicode_AsUTF8AndSize(pystring, &size);
+ const char *ptr = (char*) PyUnicode_AsUTF8AndSize(pystring, &size);
if (!ptr)
throw YACS::ENGINE::ConversionException("Conversion from PyUnicode to string failed");
mystr.assign(ptr, size);
s=PyObject_ASCII(ob); // escape non ASCII characters and like repr(), which is not the same as str()...
}
Py_ssize_t size;
- char* characters=PyUnicode_AsUTF8AndSize(s, &size);
+ const char* characters = PyUnicode_AsUTF8AndSize(s, &size);
std::string ss( characters, size);
Py_DECREF(s);
PyGILState_Release(gstate);