#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
wifstream wifs("input.txt");
wstring value;
while (wifs >> value)
{
wcout << value << endl;
}
}
input.txt : Александр Сергеевич Пушкин
That's output:
terminate called after throwing an instance of 'std::ios_base::failure'
what(): basic_filebuf::underflow invalid byte sequence in file
Aborted
File's encoding is UTF-16. I don't know why do I have such a mistake ><