diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-04-06 09:06:12 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-04-07 04:25:57 +0000 |
commit | d37239aa419ee4adff4b0a8d5c1403cadff72319 (patch) | |
tree | e5297144cecc71d30ce98511d7d4d7add69ed2d0 /src/network/access/qftp.cpp | |
parent | 3ddb2c325e832afc7deef7a48c130408130f0d9e (diff) |
QFtp: Use UTF-8 encoding.
According to RFC 2640, FTP uses UTF-8 encoding. Fix the conversions
accordingly.
Task-number: QTBUG-52303
Change-Id: I615199b3d074fc3861f25df113dda672525766b6
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
Diffstat (limited to 'src/network/access/qftp.cpp')
-rw-r--r-- | src/network/access/qftp.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/network/access/qftp.cpp b/src/network/access/qftp.cpp index 74c95ecd5e..30bb04b768 100644 --- a/src/network/access/qftp.cpp +++ b/src/network/access/qftp.cpp @@ -611,7 +611,7 @@ bool QFtpDTP::parseDir(const QByteArray &buffer, const QString &userName, QUrlIn if (buffer.isEmpty()) return false; - QString bufferStr = QString::fromLatin1(buffer).trimmed(); + QString bufferStr = QString::fromUtf8(buffer).trimmed(); // Unix style FTP servers QRegExp unixPattern(QLatin1String("^([\\-dl])([a-zA-Z\\-]{9,9})\\s+\\d+\\s+(\\S*)\\s+" @@ -676,7 +676,7 @@ void QFtpDTP::socketReadyRead() // does not exist, but rather write a text to the data socket // -- try to catch these cases if (line.endsWith("No such file or directory\r\n")) - err = QString::fromLatin1(line); + err = QString::fromUtf8(line); } } } else { @@ -932,7 +932,7 @@ void QFtpPI::readyRead() while (commandSocket.canReadLine()) { // read line with respect to line continuation - QString line = QString::fromLatin1(commandSocket.readLine()); + QString line = QString::fromUtf8(commandSocket.readLine()); if (replyText.isEmpty()) { if (line.length() < 3) { // protocol error @@ -964,7 +964,7 @@ void QFtpPI::readyRead() replyText += line; if (!commandSocket.canReadLine()) return; - line = QString::fromLatin1(commandSocket.readLine()); + line = QString::fromUtf8(commandSocket.readLine()); lineLeft4 = line.left(4); } replyText += line.mid(4); // strip reply code 'xyz ' @@ -1215,7 +1215,7 @@ bool QFtpPI::startNextCmd() qDebug("QFtpPI send: %s", currentCmd.left(currentCmd.length()-2).toLatin1().constData()); #endif state = Waiting; - commandSocket.write(currentCmd.toLatin1()); + commandSocket.write(currentCmd.toUtf8()); return true; } |