做个速记,以百度搜索为例。
void EncodePlainToURL(char *original, const char * output_param_name)
{
//将字符串编码转为UTF-8
lr_convert_string_encoding(original, LR_ENC_SYSTEM_LOCALE, LR_ENC_UTF8, "strUTF8");
//去掉C数组后面的null终止符
lr_save_string(lr_eval_string("{strUTF8}"), output_param_name);
//将UTF-8字符串URL encode
web_convert_param(output_param_name, "SourceEncoding=PLAIN", "TargetEncoding=URL", LAST);
}
Action()
{
lr_output_message("******keyword: %s", lr_eval_string("{keyword}"));
EncodePlainToURL(lr_eval_string("{keyword}"), "newKeyWord");
lr_output_message("***newKeyWord: %s", lr_eval_string("{newKeyWord}"));
web_url("s",
"URL=http://www.baidu.com/s?wd={newKeyWord}&rsv_bp=0&rsv_spt=3&ie=utf-8&rsv_sug3=4&inputT=826",
"Resource=0",
"RecContentType=text/html",
"Referer=http://www.baidu.com/",
"Snapshot=t2.inf",
"Mode=HTML",
EXTRARES,
LAST);
return 0;
}
*** walker ***
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。