Почему не работает, например, следующий код:
#include <iostream>
#include <fstream>
#include <string>
#include <locale>
using namespace std;
main()
{
  setlocale(LC_ALL, "");
  wifstream wordbase ("words.txt");
  wstring word;
  while (!wordbase.eof())
  {
    wordbase >> word;
    wcout << word <<endl;
  }
return 0;
}
terminate called after throwing an instance of 'std::ios_base::failure' what(): basic_filebuf::underflow invalid byte sequence in file Aborted
Что делать? Если везде заменить wifstream,wcout и т.п. на ifstream,cout..., то конкретно данная программа будет работать правильно, но мне надо, чтобы с отдельными символами введённых строк можно было работать.