fix:编码修正。
This commit is contained in:
		
							parent
							
								
									8b23f75383
								
							
						
					
					
						commit
						834b77d74e
					
				@ -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<std::mutex> lock(mutex_);
 | 
			
		||||
            up_[buf->fid_] = std::make_shared<TransInfomation>();
 | 
			
		||||
            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_;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user