Answer the question
In order to leave comments, you need to log in
Weird coding?
In general, I copied the text from one file to another with my hands, one file is read normally, and the second with characters of an incomprehensible encoding
setlocale(LC_ALL, "Russian");
SetConsoleOutputCP(1251);
setlocale(LC_ALL, "Russian");
//setlocale(LC_ALL, "");
std::vector<Type> *vector2 = new std::vector<Type>();
std::ifstream fin("playlist2.m3u8");
if (!fin.is_open())
{
std::cout << "File not found!" << std::endl;
}
Type elem;
std::string str="";
while (std::getline(fin,elem.filename))
{
std::getline(fin, str);
elem.length = std::stof(str);
vector2->push_back(elem);
}
fin.close();
std::cout << (*vector2)[0].filename<<std::endl<< (*vector2)[0].length << std::endl;
setlocale(LC_ALL, "ru_RU.UTF-8");
std::vector<Type> *vector3 = new std::vector<Type>();
std::ifstream fin2("playlist3.m3u8");
if (!fin2.is_open())
{
std::cout << "File not found!" << std::endl;
}
while (std::getline(fin2, elem.filename))
{
std::getline(fin2, str);
elem.length = std::stof(str);
vector3->push_back(elem);
}
fin2.close();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question