Why filename has different bytes after converting UTF16 -> UTF8 -> UTF16 in winapi?
问题 I have next file: I use ReadDirectoryChangesW for reading changes in current folder. And I get path to this file: L"TEST Ӡ⬨☐.ipt": Next, I want to convert this to utf8 and back: std::string wstringToUtf8(const std::wstring& source) { const int size = WideCharToMultiByte(CP_UTF8, 0, source.data(), static_cast<int>(source.size()), NULL, 0, NULL, NULL); std::vector<char> buffer8(size); WideCharToMultiByte(CP_UTF8, 0, source.data(), static_cast<int>(source.size()), buffer8.data(), size, NULL,