어떤 문자열이든 utf8로 바꿔주는 코드
#include #include std::string to_utf8(const std::wstring& wstr) { int size = WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), -1, nullptr, 0, nullptr, nullptr); std::string result(size - 1, 0); WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), -1, result.data(), size, nullptr, nullptr); return result;}