BUGFIX: Stop enforcing UTF-8 and use system locale instead

This commit is contained in:
Christophe Dumez 2009-07-12 08:13:00 +00:00
parent ca83fdecff
commit 0153b03160
22 changed files with 123 additions and 122 deletions

View file

@ -56,12 +56,12 @@ HttpConnection::~HttpConnection()
}
void HttpConnection::processDownloadedFile(QString url, QString file_path) {
qDebug("URL %s successfully downloaded !", (const char*)url.toUtf8());
qDebug("URL %s successfully downloaded !", (const char*)url.toLocal8Bit());
emit torrentReadyToBeDownloaded(file_path, false, url, false);
}
void HttpConnection::handleDownloadFailure(QString url, QString reason) {
std::cerr << "Could not download " << (const char*)url.toUtf8() << ", reason: " << (const char*)reason.toUtf8() << "\n";
std::cerr << "Could not download " << (const char*)url.toLocal8Bit() << ", reason: " << (const char*)reason.toLocal8Bit() << "\n";
}
void HttpConnection::read()
@ -103,7 +103,7 @@ void HttpConnection::respond()
{
//qDebug("Respond called");
QStringList auth = parser.value("Authorization").split(" ", QString::SkipEmptyParts);
if (auth.size() != 2 || QString::compare(auth[0], "Basic", Qt::CaseInsensitive) != 0 || !parent->isAuthorized(auth[1].toUtf8()))
if (auth.size() != 2 || QString::compare(auth[0], "Basic", Qt::CaseInsensitive) != 0 || !parent->isAuthorized(auth[1].toLocal8Bit()))
{
generator.setStatusLine(401, "Unauthorized");
generator.setValue("WWW-Authenticate", "Basic realm=\"you know what\"");
@ -187,7 +187,7 @@ void HttpConnection::respondCommand(QString command)
foreach(QString url, list){
url = url.trimmed();
if(!url.isEmpty()){
qDebug("Downloading url: %s", (const char*)url.toUtf8());
qDebug("Downloading url: %s", (const char*)url.toLocal8Bit());
emit UrlReadyToBeDownloaded(url);
}
}