|
如题,我在脚本里面加了将中文转成utf-8格式的编码,但是还是会报错,脚本回放的时候,已经显示a的值后面没有乱码字符了,但是100个name值中还是有30多个在测试时候失败 显示restr的值后面有乱码字符。
这个是什么原因呢 是开头的代码错误吗?
char *a;
lr_convert_string_encoding(lr_eval_string("{name}"),LR_ENC_SYSTEM_LOCALE,LR_ENC_UTF8,"UnicodeString"); //此时skey是一个汉字列表的参数,把它转换为utf-8,存入UnicodeString参数中
a=lr_eval_string("{name}");
lr_save_string(a,"restr");
web_url("login",
"URL=http://192.168.68.21:56000/login",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"Url=/css/login.css", ENDITEM,
"Url=/css/images/log-bg.jpg", ENDITEM,
"Url=/css/images/login.png", ENDITEM,
"Url=/css/themes/default/images/loading.gif", ENDITEM,
"Url=/favicon.ico", "Referer=", ENDITEM,
"Url=http://s.pc.qq.com/pcmgr/zonedword/gjzonedword20150522.js", ENDITEM,
LAST);
web_submit_form("login_2",
"Snapshot=t2.inf",
ITEMDATA,
"Name=username", "Value=TEST001", ENDITEM,
"Name=password", "Value=123456", ENDITEM,
"Name=verifyCode", "Value=", ENDITEM,
EXTRARES,
"Url=/css/images/index-head-bg.png", "Referer=http://192.168.68.21:56000/", ENDITEM,
"Url=/js/My97DatePicker/skin/WdatePicker.css", "Referer=http://192.168.68.21:56000/", ENDITEM,
"Url=/css/themes/default/images/combo_arrow.png", "Referer=http://192.168.68.21:56000/", ENDITEM,
"Url=/css/themes/default/images/tabs_icons.png", "Referer=http://192.168.68.21:56000/", ENDITEM,
"Url=/css/themes/default/images/blank.gif", "Referer=http://192.168.68.21:56000/", ENDITEM,
"Url=/css/themes/default/images/panel_tools.png", "Referer=http://192.168.68.21:56000/", ENDITEM,
"Url=/css/themes/default/images/searchbox_button.png", "Referer=http://192.168.68.21:56000/", ENDITEM,
"Url=http://s.pc.qq.com/pcmgr/zonedword/gjzonedword20150522.js", "Referer=http://192.168.68.21:56000/checklist", ENDITEM,
"Url=/css/themes/default/images/accordion_arrows.png", "Referer=http://192.168.68.21:56000/", ENDITEM,
"Url=/js/My97DatePicker/skin/datePicker.gif", "Referer=http://192.168.68.21:56000/", ENDITEM,
"Url=/css/themes/default/images/pagination_icons.png", "Referer=http://192.168.68.21:56000/", ENDITEM,
"Url=/css/images/check-working.png", "Referer=http://192.168.68.21:56000/", ENDITEM,
"Url=/css/themes/default/images/messager_icons.png", "Referer=http://192.168.68.21:56000/", ENDITEM,
"Url=/css/images/check-finish.png", "Referer=http://192.168.68.21:56000/", ENDITEM,
LAST);
lr_rendezvous("拣货");
web_custom_request("pick.json",
"URL=http://192.168.68.21:56000/order/pick.json",
"Method=POST",
"Resource=0",
"RecContentType=application/json",
"Referer=http://192.168.68.21:56000/",
"Snapshot=t12.inf",
"Mode=HTML",
"EncType=application/json; charset=utf-8",
"Body=[{\"assignId\":\"{jfd}\",\"color\":\"{yx}\",\"fwd\":\"\",\"size\":\"{dx}\",\"barcode\":\"{txm}\",\"seqno\":\"00000\",\"cancelQty\":\"0\",\"serialNum\":\"{hh}\",\"serialName\":\"{restr}\",\"num\":\"1\",\"quoPrice\":\"680\",\"endPrice\":\"680\",\"allPrice\":\"680\",\"checkNum\":\"1\"}]",
LAST);
web_submit_data("findAssignmentList.json_3",
"Action=http://192.168.68.21:56000/order/findAssignmentList.json",
"Method=POST",
"RecContentType=application/json",
"Referer=http://192.168.68.21:56000/",
"Snapshot=t13.inf",
"Mode=HTML",
ITEMDATA,
"Name=page", "Value=1", ENDITEM,
"Name=rows", "Value=20", ENDITEM,
"Name=orderStatus", "Value=0,", ENDITEM,
"Name=payId", "Value=", ENDITEM,
"Name=orderId", "Value=", ENDITEM,
"Name=platformId", "Value=", ENDITEM,
"Name=payShopIds", "Value=", ENDITEM,
"Name=sellerIds", "Value=", ENDITEM,
"Name=fromDate", "Value=20151013", ENDITEM,
"Name=toDate", "Value=20151028", ENDITEM,
"Name=sessionId", "Value=", ENDITEM,
"Name=checkStatus", "Value=0,", ENDITEM,
LAST);
return 0; |
|