$response->decoded_content; 和$response->content; 乱码问题

111 篇文章 33 订阅 ¥39.90 ¥99.00
centos6.5:/root/podinns/lib#cat t1.pl 
use  LWP::UserAgent;
use HTTP::Date qw(time2iso str2time time2iso time2isoz);
use Net::Ping;  
use Socket;
use Net::SMTP;
use LWP;
use LWP::Simple;
use LWP::UserAgent;
use HTTP::Cookies;
use HTTP::Headers;
use HTTP::Response;
use Encode;
use URI::Escape;
use URI::URL;
my $ua = LWP::UserAgent->new;
$ua->timeout(5);
$ua->env_proxy;
$ua->agent("Mozilla/8.0");
  my $cookie_jar = HTTP::Cookies->new(
      file=>'lwp_cookies.txt',
      autosave=>1,
      ignore_discard=>1);
      $ua->cookie_jar($cookie_jar);

$var='https://licai.yingyinglicai.com/index.htm';

#$var='https://licai.yingyinglicai.com/user/loginByPwd.do';
my $response = $ua->get($var);


if ($response->is_success) {
$var= $response->decoded_content;
print "\$var is $var\n";
};


centos6.5:/root/podinns/lib#cat t1.pl 
use  LWP::UserAgent;
use HTTP
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
void S1mmeSession::CtEncodeKqi(S1MMEKQI* kqi, S1APNode* p_node, uint8_t worker_id) { MsgCommonInfo& common = p_node->GetCommonInfo(); SPUserInfo& sp_user_info = p_node->GetUserInfo(); //获取 buf TlvEncoder* p_encoder_cur = g_p_encoder_[worker_id]; YdCDR_T* p_dst_data = (YdCDR_T*)malloc(sizeof(YdCDR_T)); if (p_dst_data == NULL) { return; } p_dst_data->not_associate = 0; if ((common.not_associate & 0x03) == 0x03) p_dst_data->not_associate = 1; p_encoder_cur->Set(p_dst_data->cdr_data,kMaxOneCdrBufLen); uint64_t imsi = sp_user_info->GetIMSI(); if(common.eci == 0) { common.eci = sp_user_info->GetEci(); } uint16_t tmp_enbid = common.tac;//>>8; //uint32_t tmp_enbid = (common.eci >> 8)&0xfffff; char xdrid_str[32]={0}; #ifdef OPEN_NEW_HUISU convert_xdrid_to_string(xdrid_str, kqi->xdrid, s_xdr_id_len); #else #ifdef OPENCTPR g4sigtran::pr::ProcBlock* p_blk = kqi->binary_block_in_xdr_.GetBlock(); p_blk->SerializeXid(xdrid_str, sizeof(xdrid_str)); #else uint64_t subcdrid = g_ct_xdr_id.GetXid(); //reverse subend; if(::is_open_reverse) { SetReverseSubend(p_node, subcdrid); } #ifdef ONE_THIRD_YUNNAN_MRO g_ct_xdr_id.Serialize((uint8_t*)xdrid_str, s_xdr_id_len, imsi); #else g_ct_xdr_id.Serialize((uint8_t*)xdrid_str, s_xdr_id_len); #endif #endif #endif struct timespec start_time = kqi->request_time_, end_time = kqi->response_time_; if (kqi->request_time_.tv_sec == 0) { if (!(kqi->response_time_.tv_sec == 0)) { start_time = kqi->response_time_; } else if (!(kqi->complete_time_.tv_sec == 0)) { start_time = kqi->complete_time_; } }要求:在S1mmeSession::CtEncodeKqi函数后面新加一个函数,来维护一组key、value的关系。 key为:imsi value为:imsi、imei、common.eci、common.tac、last_time 当imsi相同时,以最后一条记录的value内容为准进行保存;imsi不同时直接插入。请用C++实现该功能,需要用到哈希的知识点
最新发布
06-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

scan724

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值