I don’t think so. wchar_t
is designed before UTF-8 era.
Using wchar_t
in right way on Unix is hard. It is based on locale. mbstowcs
may be buggy on some systems.
I don’t want to learn about wchar_t
. I don’t want to force young people to learn about wchar_t
too.
For example, vim uses Py_SetPythonHome
. See this code.
Strictly speaking, vim should use Py_DecodeLocale
instead of mbstowcs
here, if I understand the API correctly. But I’m not sure.
This is one example of how embedding Python correctly on Unix is difficult.
path is bytes in Unix. So char*
based APIs is simple and easy to configure paths.