From 3879da592d689d551778b710c21c8a95d2874ab3 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 4 Aug 2011 21:43:02 +0900 Subject: In MinGW32, open file with UNICODE filename and print them in ANSI. --- src/HttpResponseCommand.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/HttpResponseCommand.cc') 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; } -- cgit