MCPcopy Create free account
hub / github.com/Kitware/VTK / vtk_Py_UTF8ToWide

Function vtk_Py_UTF8ToWide

Utilities/PythonInterpreter/vtkPythonInterpreter.cxx:86–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84using WCharStringPool = PoolT<wchar_t>;
85
86wchar_t* vtk_Py_UTF8ToWide(const char* arg)
87{
88 wchar_t* result = nullptr;
89 if (arg != nullptr)
90 {
91 size_t length = vtksysEncoding_mbstowcs(nullptr, arg, 0);
92 if (length > 0)
93 {
94 result = (wchar_t*)PyMem_RawMalloc(sizeof(wchar_t) * (length + 1));
95 vtksysEncoding_mbstowcs(result, arg, length + 1);
96 }
97 }
98
99 return result;
100}
101
102#if PY_VERSION_HEX < 0x03080000
103std::string vtk_Py_WideToUTF8(const wchar_t* arg)

Callers 3

InitializeWithArgsMethod · 0.85
SetProgramNameMethod · 0.85
PyMainMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected