From 834b77d74ebd7313fd7f027ce431fc1560c71f42 Mon Sep 17 00:00:00 2001 From: taynpg Date: Tue, 17 Dec 2024 09:34:37 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E7=BC=96=E7=A0=81=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/client.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client/client.cpp b/client/client.cpp index 38d41b6..8e140e2 100644 --- a/client/client.cpp +++ b/client/client.cpp @@ -133,7 +133,7 @@ bool CClient::cancel_task() bool CClient::down_one_file(const std::string& id, const std::string& file) { down_->cur_remote_id_ = id; - down_->cur_remote_file_ = file; + down_->cur_remote_file_ = CCodec::u8ToGBK(file); fs::path remote_file(ofen::COfPath::normalize(down_->cur_remote_file_)); down_->cur_file_ = COfPath::to_full(remote_file.filename().string()); @@ -220,12 +220,8 @@ void CClient::handle_frame(CFrameBuffer* buf) if (real.empty()) { continue; } - -#ifdef _WIN32 - real = CCodec::u8ToGBK(real); -#endif if (real.find("[") == std::string::npos) { - logger_->info("FILE ==> {}", real); + logger_->info("FILE ==> {}", CCodec::u8ToGBK(real)); task_list_[index]->files.push_back(real); } else { auto a = real.find_first_of("[") + 1; @@ -274,7 +270,11 @@ void CClient::handle_frame(CFrameBuffer* buf) std::lock_guard lock(mutex_); up_[buf->fid_] = std::make_shared(); t = up_[buf->fid_]; +#ifdef _WIN32 + t->cur_file_ = CCodec::u8ToGBK(std::string(buf->data_, buf->len_)); +#else t->cur_file_ = std::string(buf->data_, buf->len_); +#endif t->file_ = fopen(t->cur_file_.c_str(), "rb"); } else { t = down_;