MCPcopy Create free account
hub / github.com/pybind/pybind11 / unicode_from_fs_native

Function unicode_from_fs_native

include/pybind11/stl/filesystem.h:38–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36
37private:
38 static PyObject *unicode_from_fs_native(const std::string &w) {
39# if !defined(PYPY_VERSION)
40 return PyUnicode_DecodeFSDefaultAndSize(w.c_str(), ssize_t(w.size()));
41# else
42 // PyPy mistakenly declares the first parameter as non-const.
43 return PyUnicode_DecodeFSDefaultAndSize(const_cast<char *>(w.c_str()), ssize_t(w.size()));
44# endif
45 }
46
47 static PyObject *unicode_from_fs_native(const std::wstring &w) {
48 return PyUnicode_FromWideChar(w.c_str(), ssize_t(w.size()));

Callers 1

castFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected