C++ 멀티바이트 문자열을 UTF-8로 변경하는 함수
1234567891011121314151617181920212223242526#include #include #include using namespace std; std::string multibyte_to_utf8(const std::string& str) { int nLen = str.size(); wchar_t warr[256]; MultiByteToWideChar(CP_ACP, 0, (LPCSTR)str.c_str(), -1, warr, 256); char carr[256]; memset(carr, '\0', sizeof(carr)); WideCharToMultiByte(CP_UTF8, 0, warr, -1, carr, 256, NULL, NULL); return carr;} std::string..