--- qt.orig/src/network/qftp.cpp Thu Jul 29 12:21:16 EST 2004 +++ qt/src/network/qftp.cpp Thu Jul 29 12:21:16 EST 2004 @@ -48,6 +48,10 @@ #include "qfileinfo.h" #include "qptrdict.h" // binary compatibility +#ifndef QT_NO_TEXTCODEC +#include "qtextcodec.h" +#endif + //#define QFTPPI_DEBUG //#define QFTPDTP_DEBUG @@ -916,6 +920,10 @@ return TRUE; } +#ifndef QT_NO_TEXTCODEC +Q_EXPORT QTextCodec *qt_ftp_filename_codec = 0; +#endif + /* Starts next pending command. Returns FALSE if there are no pending commands, otherwise it returns TRUE. @@ -941,7 +949,16 @@ qDebug( "QFtpPI send: %s", currentCmd.left( currentCmd.length()-2 ).latin1() ); #endif state = Waiting; - commandSocket.writeBlock( currentCmd.latin1(), currentCmd.length() ); +#ifndef QT_NO_TEXTCODEC + if ( qt_ftp_filename_codec ) { + int len; + QCString enc = qt_ftp_filename_codec->fromUnicode(currentCmd,len); + commandSocket.writeBlock( enc.data(), len ); + } else +#endif + { + commandSocket.writeBlock( currentCmd.latin1(), currentCmd.length() ); + } return TRUE; } --- qt.orig/include/qglobal.h Thu Jul 29 12:21:16 EST 2004 +++ qt/include/qglobal.h Thu Jul 29 12:21:16 EST 2004 @@ -43,6 +43,7 @@ QT_VERSION is (major << 16) + (minor << 8) + patch. */ #define QT_VERSION 0x030300 +#define QT_FTP_FILENAME_CODEC_PATCH_APPLIED /* The operating system, must be one of: (Q_OS_x)