|
如果单独用web_convert_param("WCSP4","SourceEncoding=HTML","TargetEncoding=URL", LAST);还出现乱码,那就要将lr_convert_string_encoding和web_convert_param两者结合用;先用lr_convert_string_encoding,再用web_convert_param
如:
char tmp[50];
web_reg_save_param( "WCSP4", "LB=EVENTVALIDATION\" value=\"", "RB=\"", "Ord=1", "Search=Body", LAST );
web_url("WorkflowView.aspx", "URL=XXXXX", "Snapshot=t1.inf", "Mode=HTML", LAST );
lr_convert_string_encoding(lr_eval_string("{WCSP4}"),LR_ENC_SYSTEM_LOCALE,LR_ENC_UTF8,"str");
//将[中文]转换为UTF-8格式的字符
strcpy(tmp,lr_eval_string("{str}"));
//将转换后的字符存入tmp变量中
lr_log_message("str is %s",tmp);
lr_save_string(tmp,"WCSP4_1");
web_convert_param("WCSP4_1","SourceEncoding=HTML","TargetEncoding=URL", LAST);
web_submit_data("WorkflowView.aspx","Action=XX",.....ITEMDATA, "Name=__EVENTVALIDATION", "Value={WCSP4_1}", ENDITEM, ......LAST); |
|