找了很多方法,utf-8也设置了,还是不行,只有有转码方法了
web_reg_save_param("res2",
"LB="msg":"",
"RB="",
"Search=Body",
LAST);
lr_start_transaction("Web_注册_register_bean");
web_custom_request("web_custom_request",
"URL=http://{ip}/api/user/register",
"Method=POST",
"Resource=0",
"RecContentType=application/json",
"Referer=",
"Mode=HTTP",
"EncType=application/json",
"Body={"username":"131{NewParam}","password": "123456"}",
LAST);
lr_convert_string_encoding(lr_eval_string("{res2}"),"utf-8",NULL,"msg");//将返回消息responseMsg值做编码转换
lr_output_message("转换编码后msg----%s",lr_eval_string("{msg}"));
if(strcmp(lr_eval_string("{msg}"),"注册成功")==0)
其实很简单,就是把原来返回的字符串res2,通过转码变成新的字符串msg.
再通过新的字符串msg与实际返回值进行比较