LR用 lr_convert_string_encoding中文转码时遇到的问题
这是一个简单的商品搜索的脚本,由于输入的商品名为中文,所以录制出来的中文为乱码,因此我使用lr_convert_string_encoding函数进行转码,以下是我修改的代码,但是运行出来的结果有误(errors, not writing pre_cci.ci)。脚本与运行的结果如下:运行的脚本:
Action(){
web_url("192.168.2.214",
"URL=http://192.168.2.214/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t45.inf",
"Mode=HTML", LAST);
lr_think_time(7);
char temp;
char hotelname;
lr_convert_string_encoding(lr_eval_string("惠普"),LR_ENC_SYSTEM_LOCALE, LR_ENC_UTF8 ,"temp");
strcat(hotelname,lr_eval_string ( "{temp}" ));
web_url("retrieval!run.action",
"URL=http://192.168.2.214/retrieval!run.action?mk=0&dir=-1&ord=3&rs={hotelname}",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t46.inf",
"Mode=HTML", LAST);
return 0;}
运行的结果:
Action.c (17): illegal statement termination
Action.c (17): skipping `char'Action.c (17): undeclared identifier `temp'
Action.c (18): illegal statement termination
Action.c (18): skipping `char'
Action.c (18): undeclared identifier `hotelname'
Action.c (18): type error: pointer expectedc:\\documents and settings\\administrator\\local settings\\temp\\noname29\\\\combined_noname29.c (5): 7 errors, not writing pre_cci.ci 这个是c的语法错误,变量定义要在最前面
页:
[1]