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:
Sebastian Hoogen
2015-01-31 22:36:39 +01:00
committed by wmayer
parent 8ee81e0516
commit faac8c36ba
8 changed files with 31 additions and 31 deletions

View File

@@ -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