LoadRunner中文出现乱码的解决办法
录制选项,高级,支持字符集,UTF-8。
一般情况下不需要开启此选项,否则在Submit里会出现有乱码。
如果未开启此功能还出现乱码,可尝试开启此选项。
如果开启此选项还是有乱码,且乱码处的内容你需要进行参数化,可使用lr_convert_string_encoding函数将字符转化为你需要的模式。
函数原型:
intlr_convert_string_encoding(constchar*sourceString,constchar*fromEncoding,constchar*toEncoding,constchar*paramName);sourceStringThe string to convertfromEncodingThe encoding of the sourceStringtoEncodingThe encoding to convert of the string saved in parameterparamNameparamNameThe name of the parameter in which the destination string will be savedConstant Value
LR_ENC_SYSTEM_LOCALENULLLR_ENC_UTF8"utf-8"LR_ENC_UNICODE"ucs-2"
浏览器也有转码功能:菜单“查看”-->编码-->Unicode(UTF-8)
为什么要启用UTF-8,某些请求中会出现:
"EncType=text/xml; charset=UTF-8",
……);
这时候,此函数你就派得上用场了!
lr_convert_string_encoding函数的使用,直接查看帮助即可。
说明:
1. 在树视图里的源码(server Response)的乱码是没法解决的;
2. 在树视图的页面显示可以是正常,源码视图也可以显示正常;
3. 虽然在server Response显示乱码,但查找中文字符串还是正常的
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。