add encoding parameter to .as_std_string()
to handle PyUnicode Objects. Usually ASCII for object names and Utf-8 for file names and console output. issue #995
This commit is contained in:
@@ -104,7 +104,7 @@ std::string PropertyPythonObject::toString() const
|
||||
args.setItem(0, dump);
|
||||
Py::Object res = method.apply(args);
|
||||
Py::String str(res);
|
||||
repr = str.as_std_string();
|
||||
repr = str.as_std_string("ascii");
|
||||
}
|
||||
catch (Py::Exception&) {
|
||||
Base::PyException e; // extract the Python error text
|
||||
|
||||
Reference in New Issue
Block a user