add support for std::wstring following std::string
In some cases, wchar_t strings are preferable to UTF-8 strings for non-ascii string. So add support for std::wstring following std::string using provided Python API.
The caster looks good, but this PR will need test coverage to be considered for inclusion.
(nvm, I will ad them myself)
Doesn't the PyUnicode_AsWideCharString(src.ptr(), &size) call in this conversion leak memory?
PyUnicode_AsWideCharString returns a buffer allocated by PyMem_New (use PyMem_Free() to free it) on success. On error, returns NULL and *size is undefined. Raises a MemoryError if memory allocation is failed.
For context, I'm writing a caster for std::u32string and std::u32string_view types and was thinking of using this std::wstring caster as a reference.