PWSTR myPwstr; std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t> convert; std::string stringified = convert.to_bytes(myPwstr); const char* result = stringified.cstr();