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:

 

评分:0

我来说两句

我的栏目

日历

« 2024-05-02  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 55203
  • 日志数: 15
  • 文件数: 1
  • 书签数: 1
  • 建立时间: 2009-01-02
  • 更新时间: 2016-08-06

RSS订阅

Open Toolbar