Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QString d;
- QFile f(QDir::currentPath() + "/input.txt");
- if( f.open( QIODevice::ReadOnly | QIODevice::Text ) )
- {
- d = f.readAll();
- f.close();
- }
- auto cutf8 = QTextCodec::codecForName("UTF-8");
- auto cw50 = QTextCodec::codecForName("windows-1250");
- auto cw51 = QTextCodec::codecForName("windows-1251");
- QFile ff(QDir::currentPath() + "/output.txt");
- if( ff.open( QIODevice::WriteOnly | QIODevice::Text ) )
- {
- QTextStream t(&ff);
- QTextStream* tt = new QTextStream(t.device());
- tt->setCodec(cutf8);
- *tt << d << "\r\n";
- tt->flush();
- delete tt;
- tt = new QTextStream(t.device());
- tt->setCodec(cw50);
- *tt << d << "\r\n";
- tt->flush();
- delete tt;
- tt = new QTextStream(t.device());
- tt->setCodec(cw51);
- *tt << d << "\r\n";
- tt->flush();
- delete tt;
- }
- ff.close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement