Loadrunner 实现封装关联乱码转utf8

void Utf8Charset(char *input_log, const char * output_log){
	lr_convert_string_encoding(input_log, "utf-8", NULL, "output_log");
	lr_save_string(lr_eval_string("{output_log}"), output_log);
}

Action()
{
	char log[1024];
	web_set_max_html_param_len("1024");
	web_reg_save_param("log",
		"LB=",
		"RB=",
		"Search=Body",
		LAST);

    
	web_submit_data("test",
		"Action=API地址", // api地址
		"Method=GET",
		"TargetFrame=",
		"Referer=",
		ITEMDATA,
		LAST);

	lr_message(lr_eval_string("{log}"));  //输出的是乱码

	Utf8Charset(lr_eval_string("{log}"), "utf8Log");  //乱码转utf8
	lr_message(lr_eval_string("{utf8Log}"));

	return 0;
}

你可能感兴趣的:(Loadrunner学习)