Например, так
Код | setlocale (LC_ALL, "russian_russia"); std::ifstream file_in("dataBase.txt"); file_in.seekg (0, std::ios_base::end); std::streamoff size = file_in.tellg (); file_in.seekg (0, std::ios_base::beg); char *ch = new char [size]; file_in.read (ch, size); int retsize = MultiByteToWideChar (CP_UTF8, MB_ERR_INVALID_CHARS, ch, size, NULL, 0); wchar_t *ch2 = new wchar_t [retsize + 1]; ch2 [retsize] = L'\0'; MultiByteToWideChar (CP_UTF8, MB_ERR_INVALID_CHARS, ch, size, ch2, retsize); std::wcout << ch2 <<std::endl;
delete [] ch; delete [] ch2;
|
|