loadrunner转码函数的学习
上一篇 /
下一篇 2016-01-05 16:37:13
/ 个人分类:原稿
Action()
/*
int lr_convert_string_encoding( const char *sourceString, const char *fromEncoding, const char *toEncoding, const char *paramName);
sourceString The string to convert 需要转换的字符
fromEncoding The encoding of the sourceString 原来字符的编码
toEncoding The encoding to convert of the string saved in parameter paramName 需要转换成的编码
paramName The name of the parameter in which the destination string will be saved 保存转码后的字符的变量名称
*/
lr_start_transaction("convert");
lr_convert_string_encoding(lr_eval_string("
智能手机"),"gb2312","utf-8","a1");//把智能手机编码从gb2312转成utf-8,放在a1中,在函数中使用的时候直接{a1}使用就可以了
lr_convert_string_encoding(lr_eval_string("{a1}"),"utf-8","gb2312","bb");//把刚才转码的再转一次还原,给下面的语句来打印它
lr_output_message(lr_eval_string("{bb}"));
lr_end_transaction("convert",LR_AUTO);
return 0;
}
收藏
举报
TAG: