summaryrefslogtreecommitdiff
path: root/src/HttpResponseCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-08-04 21:43:02 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-08-04 21:43:02 +0900
commit3879da592d689d551778b710c21c8a95d2874ab3 (patch)
tree121df06eeb860738ff2c5b6abd3c89fb8b09db7b /src/HttpResponseCommand.cc
parent45686860e1b5e94bfa8fa95603f101cce53ed4b1 (diff)
In MinGW32, open file with UNICODE filename and print them in ANSI.
Diffstat (limited to 'src/HttpResponseCommand.cc')
-rw-r--r--src/HttpResponseCommand.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/HttpResponseCommand.cc b/src/HttpResponseCommand.cc
index 0f25f757..2610d0e3 100644
--- a/src/HttpResponseCommand.cc
+++ b/src/HttpResponseCommand.cc
@@ -186,9 +186,10 @@ bool HttpResponseCommand::executeInternal()
getPieceStorage()->markAllPiecesDone();
// Just set checksum verification done.
getDownloadContext()->setChecksumVerified(true);
- A2_LOG_NOTICE(fmt(MSG_DOWNLOAD_ALREADY_COMPLETED,
- util::itos(getRequestGroup()->getGID()).c_str(),
- getRequestGroup()->getFirstFilePath().c_str()));
+ A2_LOG_NOTICE
+ (fmt(MSG_DOWNLOAD_ALREADY_COMPLETED,
+ util::itos(getRequestGroup()->getGID()).c_str(),
+ utf8ToNative(getRequestGroup()->getFirstFilePath()).c_str()));
poolConnection();
getFileEntry()->poolRequest(getRequest());
return true;
@@ -257,7 +258,7 @@ bool HttpResponseCommand::executeInternal()
isSameFileBeingDownloaded(getRequestGroup())) {
throw DOWNLOAD_FAILURE_EXCEPTION2
(fmt(EX_DUPLICATE_FILE_DOWNLOAD,
- getRequestGroup()->getFirstFilePath().c_str()),
+ utf8ToNative(getRequestGroup()->getFirstFilePath()).c_str()),
error_code::DUPLICATE_DOWNLOAD);
}
// update last modified time
@@ -438,9 +439,10 @@ bool HttpResponseCommand::handleOtherEncoding
getRequestGroup()->initPieceStorage();
getPieceStorage()->markAllPiecesDone();
getDownloadContext()->setChecksumVerified(true);
- A2_LOG_NOTICE(fmt(MSG_DOWNLOAD_ALREADY_COMPLETED,
- util::itos(getRequestGroup()->getGID()).c_str(),
- getRequestGroup()->getFirstFilePath().c_str()));
+ A2_LOG_NOTICE
+ (fmt(MSG_DOWNLOAD_ALREADY_COMPLETED,
+ util::itos(getRequestGroup()->getGID()).c_str(),
+ utf8ToNative(getRequestGroup()->getFirstFilePath()).c_str()));
poolConnection();
return true;
}