I try send a string from c++ to python string using:
PyObject* pyString = PyUnicode_FromString("/abc/def.html/a%22.php?abc=&def=%22;%00s%01");
....
PyObject* pyArgs = Py_BuildValue("(z)", pyString);
...
PyObject_CallObject(pFunc, pyArgs);
But in script the string is bad:
function(data):
print(data)
The result is:
/abc/def.html/a bogus %pp?abc=&def= %;(null)%
What happened?, If I try to escape %
chars with %%
works fine, but PyUnicode_FromString
is not a printf format.
Is this a bug of PyUnicode_FromString
function?, Do I need a native python escape? Or do I need to manually escape?