diff --git a/src/downloads/downloadfilehelper.cpp b/src/downloads/downloadfilehelper.cpp index cfa53d0aa..d298c4871 100644 --- a/src/downloads/downloadfilehelper.cpp +++ b/src/downloads/downloadfilehelper.cpp @@ -193,7 +193,7 @@ QString DownloadFileHelper::getFileName(QNetworkReply* reply) { QString path; if (reply->hasRawHeader("Content-Disposition")) { - QString value = reply->rawHeader("Content-Disposition"); + QString value = QString::fromLatin1(reply->rawHeader("Content-Disposition")); int pos = value.indexOf("filename="); if (pos != -1) { QString name = value.mid(pos + 9); @@ -207,6 +207,8 @@ QString DownloadFileHelper::getFileName(QNetworkReply* reply) path = reply->url().path(); } + path = qz_filterCharsFromFilename(path); + QFileInfo info(path); QString baseName = info.completeBaseName(); QString endName = info.suffix();