LoadRunner中文出现乱码的解决办法

上一篇 / 下一篇  2019-02-18 19:56:32 / 个人分类:第二博客


录制选项,高级,支持字符集,UTF-8。
一般情况下不需要开启此选项,否则在Submit里会出现有乱码。
如果未开启此功能还出现乱码,可尝试开启此选项。

如果开启此选项还是有乱码,且乱码处的内容你需要进行参数化,可使用lr_convert_string_encoding函数将字符转化为你需要的模式。

函数原型:

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
Constant Value
LR_ENC_SYSTEM_LOCALE
NULL
LR_ENC_UTF8
"utf-8"
LR_ENC_UNICODE
"ucs-2"

浏览器也有转码功能:菜单“查看”-->编码-->Unicode(UTF-8)

为什么要启用UTF-8,某些请求中会出现:
web_custom_request("CALL-H001I",
        "EncType=text/xml; charset=UTF-8",
……);


这时候,此函数你就派得上用场了!

lr_convert_string_encoding函数的使用,直接查看帮助即可。

说明:
1. 在树视图里的源码(server Response)的乱码是没法解决的;
2. 在树视图的页面显示可以是正常,源码视图也可以显示正常;
3. 虽然在server Response显示乱码,但查找中文字符串还是正常的


TAG:

 

评分:0

我来说两句

binning_001

binning_001

因为不是天生丽质,所以必须天生励志

我的栏目

日历

« 2024-03-23  
     12
3456789
10111213141516
17181920212223
24252627282930
31      

数据统计

  • 访问量: 87119
  • 日志数: 66
  • 建立时间: 2008-04-20
  • 更新时间: 2019-02-23

RSS订阅

Open Toolbar