You are mentioning string
but you say it's a Unicode string. So then I suppose you mean wstring
. You could use the MultiByteToWideChar function to convert between the two. Something like this:
std::string str(...);
int size = MultiByteToWideChar(CP_UTF8, 0, &str[0], (int)str.size(), NULL, 0);
std::wstring wstr(size, 0 );
MultiByteToWideChar(CP_UTF8, 0, &str[0], (int)str.size(), &wstr[0], size);