I’m trying to open file using wifstream:
#include <sstream>
#include <fstream>
wstring readFile(const char* filename)
{
wifstream wif(filename);
wstringstream wss;
wss << wif.rdbuf();
return wss.str();
}
It is reading file that conatains english and russian symbols and placing text into wstring.
Then, I tried to print all of that into console and all russian symbols were replaced with another. English symbols were correct.
I found, that all characters codes (like u…) of replaced symbols are right. Also them were out of ASCII table, like å – U+00E5 (en.wikipedia.org/wiki/List_of_Unicode_characters)
I think there’s problem in decoding file into utf-8.
Илья Черепанов is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.