From 208cd56ee36e1c449eafbdaf698e608240dc3139 Mon Sep 17 00:00:00 2001 From: taynpg Date: Tue, 17 Dec 2024 09:40:18 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=AD=A3Linux=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/client.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/client.cpp b/client/client.cpp index 8e140e2..1ed14a5 100644 --- a/client/client.cpp +++ b/client/client.cpp @@ -133,11 +133,15 @@ bool CClient::cancel_task() bool CClient::down_one_file(const std::string& id, const std::string& file) { down_->cur_remote_id_ = id; +#ifdef _WIN32 down_->cur_remote_file_ = CCodec::u8ToGBK(file); +#else + down_->cur_remote_file_ = file; +#endif fs::path remote_file(ofen::COfPath::normalize(down_->cur_remote_file_)); down_->cur_file_ = COfPath::to_full(remote_file.filename().string()); - logger_->warn("Start Down => {} To {}", file, down_->cur_file_); + logger_->warn("Start Down => {} To {}", down_->cur_remote_file_, down_->cur_file_); // 请求下载文件 std::shared_ptr buf = std::make_shared(); @@ -221,7 +225,11 @@ void CClient::handle_frame(CFrameBuffer* buf) continue; } if (real.find("[") == std::string::npos) { +#ifdef _WIN32 logger_->info("FILE ==> {}", CCodec::u8ToGBK(real)); +#else + logger_->info("FILE ==> {}", real); +#endif task_list_[index]->files.push_back(real); } else { auto a = real.find_first_of("[") + 1;