C++ (Qt)QFile fileFrom( "c:/папка-с-русскими-символами/file.exe" );if( fileFrom.copy( "c:/test/dest.exe" ) ){..ok..} else {..fail..}
C++ (Qt)QFile fileFrom(QFile::decodeName("c:/папка-с-русскими-символами/file.exe")) ;
QTextCodec *tc = QTextCodec::codecForName("utf-8");QTextCodec::setCodecForTr(tc);
#include <QtCore>int main(int argc, char **argv){ QCoreApplication app(argc, argv); QTextCodec *tc = QTextCodec::codecForName("windows-1251"); QTextCodec::setCodecForCStrings ( tc ) ; QFile necro("C:/Некрономикон.pdf"); bool res = necro.copy("C:/Necronomycon.pdf"); if ( !res ) qDebug() << necro.errorString(); else qDebug() << "OK";}// Output: OK
C++ (Qt)boost::filesystem::copy_file("from", "to");
C++ (Qt)void copyfile(const std::string& to, const std::string& from) { std::ofstream(to.c_str(), std::ios::binary) << std::ifstream(from.c_str(), std::ios::binary).rdbuf();}