Possible Duplicate:
UTF8 to/from wide char conversion in STL
I know how to convert UTF8 to std::wstring using MultiByteToWideChar:
std::wstring utf8to16( const char* src )
{
std::vector<wchar_t> buffer;
buffer.resize(MultiByteToWideChar(CP_UTF8, 0, src, -1, 0, 0));
MultiByteToWideChar(CP_UTF8, 0, src, -1, &buffer[0], buffer.size());
return &buffer[0];
}
but it is Windows-specific, is there a cross-platform C++ function that does the same thing, using only stdio or iostream?