lr_convert_string_encoding

Converts a string to a different encoding.

Return Values:This function returns 0 on success and -1 on failure.

C Language

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_convert_string_encoding converts a string encoding between the following encodings: System locale, Unicode, and UTF-8. The function saves the result string, including its terminating NULL, in the parameter paramName.

Printable characters in the result string are displayed in VuGen and its logs as the actual characters. Non-printable characters are displayed in Hexadecimal. For example:

rc = lr_convert_string_encoding("A", NULL, LR_ENC_UTF8, "stringInUnicode");

The result string displays as A\x00, and not \x41\x00, because the letter A is a printable character.

Add lr_convert_string_encoding manually to a script when needed. It is not recorded.

Possible values for 'fromEncoding' and 'toEncoding' :

Constant Value
LR_ENC_SYSTEM_LOCALE NULL
LR_ENC_UTF8 "utf-8"
LR_ENC_UNICODE "ucs-2"


rc = lr_convert_string_encoding(lr_eval_string("{buy_result}"), LR_ENC_UTF8, LR_ENC_SYSTEM_LOCALE, "stringInUnicode");

1.rc是返回值,为0表示转换成功,为-1表示失败

2.lr_eval_string("{buy_result}")待转换的字符

3.LR_ENC_UTF8待转换字符的初始编码格式

4.LR_ENC_SYSTEM_LOCALE需要把待转换字符转换成的格式,一般是转换为本地的默认格式

5."stringInUnicode"存储转换后字符串的变量名称。

LoadRunner显示中文乱码的问题的更多相关文章

  1. JUCE 界面库显示中文乱码问题

    JUCE 界面库显示中文乱码问题 环境: Windows7 64位 旗舰版 Visual Studio Ultimate 2012 JUCE 4.1 问题描述: 直接使用juce::String存储中 ...

  2. 转:jsp页面显示中文乱码解决方案

    jsp页面显示中文乱码: jsp页面的编码方式有两个地方需要设置: <%@ page language="java" import="java.util.*&quo ...

  3. Phantomjs 在cmd命令行显示中文乱码

    cmd命令行窗口显示中文乱码 cmd中文支持gbk编码 在js执行文件中加上(一般在最开始加) phantom.outputEncoding="gbk"; 这样乱码就正确了

  4. Win 7英文系统显示中文乱码的解决(转)

    Win 7英文系统显示中文乱码的解决http://www.enet.com.cn/article/2011/0811/A20110811896633.shtml 请点击Startmenu并点击Cont ...

  5. XShell连接 Linux系统,显示中文乱码

    摘要: Linux系统,中文显示乱码 XShell是一个强大的安全终端模拟软件,它支持SSH1, SSH2及 Microsoft Windows平台的Telnet NetSarang Xshell 4 ...

  6. SSH Secure Shell Client连接Linux 命令行显示中文乱码问题 和oracle 查询数据中文乱码问题

    一.SSH Secure Shell Client连接Linux 命令行显示中文乱码问题 linux 设置系统语言 修改 /etc/sysconfig/i18n 文件,如 LANG="en_ ...

  7. 解决Linux文档显示中文乱码问题以及编码转换

    解决Linux文档显示中文乱码问题以及编码转换 解决Linux文档显示中文乱码问题以及编码转换 使vi支持GBK编码 由于Windows下默认编码是GBK,而linux下的默认编码是UTF-8,所以打 ...

  8. 两种解决Qt5显示中文乱码的方法(使用QStringLiteral和#pragma execution_character_set("utf-8")两种方法)

    升级到Qt5.X之后,原先解决的Qt显示中文乱码的方法突然不适用了,找了很多方式来解决这个问题第一种:在公司代码里看到的方法,先将对应的cpp文件用windows自带的记事本打开,另存为UTF-8格式 ...

  9. RoportNG报表显示中文乱码和TestNG显示中文乱码实力解决办法

    最近在进军测试自动化框架学习阶段,但无意间总是会伴随小问题的困扰,比如中文乱码,而导致显示总是不舒服,个人觉得,就一定要解决,似乎有点点强迫症.所以遇到RoportNG报表显示中文乱码和TestNG显 ...

随机推荐

  1. linux关机和重启的命令[转]

    如果你很急着关机或者重启话,那么关机就是init 0,重启就是init 6或者reboot Linux中常用的关机和重新启动命令有shutdown.halt.reboot以及init,它们都可以达到关 ...

  2. poj 2411 Mondriaan's Dream(状态压缩dP)

    题目:http://poj.org/problem?id=2411 Input The input contains several test cases. Each test case is mad ...

  3. android中给TextView或者Button的文字添加阴影效果

    1在代码中添加文字阴影 TextView 有一个方法 /**      * Gives the text a shadow of the specified radius and color, the ...

  4. UVa 12063 (DP) Zeros and Ones

    题意: 找出长度为n.0和1个数相等.没有前导0且为k的倍数的二进制数的个数. 分析: 这道题要用动态规划来做. 设dp(zeros, ones, mod)为有zeros个0,ones个1,除以k的余 ...

  5. ios9下ionic框架报[$rootScope:infdig] 10 $digest() iterations reached. Aborting!的解决办法

    升级ios9后,ionic开发的app会报[$rootScope:infdig] 10 $digest() iterations reached. Aborting!的错误,加上一个patch就可以解 ...

  6. this class is not key value coding-compliant for the key ##

    setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key ## 出现以上错误时很恶心,并 ...

  7. QPS、PV和需要部署机器数量计算公式(转)

    术语说明: QPS = req/sec = 请求数/秒 [QPS计算PV和机器的方式] QPS统计方式 [一般使用 http_load 进行统计] QPS = 总请求数 / ( 进程总数 *   请求 ...

  8. 【C#学习笔记】类型转换

    using System; namespace ConsoleApplication { class Program { static void Main(string[] args) { " ...

  9. 利用ffmpeg解码h264流的代码

    这里也直接给出代码: h264dec.h: #pragma once #include "tdll.h" #include "avcodec.h" #inclu ...

  10. UML类图设计

    大纲: 在Visio里,包和类的关系是包含关系,将类拖入包的文件夹之后,关系就建立了,二元关联符号可以设置为:聚合.合成.接口:空心圆+直线(唐老鸭类实现了‘讲人话’):依赖:虚线+箭头(动物和空气的 ...