lr_convert_string_encoding函数的使用

上一篇 / 下一篇  2010-04-27 11:04:52 / 天气: 晴朗 / 心情: 高兴 / 个人分类:lr

51Testing软件测试网'O$x)A3~s0I

由于url不能传输汉字,所以程序要把汉字转换一下,lr怎么参数化呢

yd'G^M1M7h3j0

2g1vyUhI C?b0看下面的列子

%nK`8jUk[l;a']051Testing软件测试网KJi2]~7m

 web_url("0.00",51Testing软件测试网 ` w:[.GV-h;w
  "URL=http://192.168.0.15/xxx/xxx/xxx.aspx?HotelName=%e5%8c%97%e4%ba%ac%e5%8d%8e%e5%87%af%e5%ae%be%e9%a6%86",51Testing软件测试网8O%A lmq u(vP
  "Resource=0",
)v9W Ay$a4]5`R;[.BV0  "RecContentType=text/html",
-{d+C?E8a!v0  "Referer=http://192.168.0.15/xxx/xxx/xxx.aspx?hotelid=00101210&hotelname=%e5%8c%97%e4%ba%ac%e5%8d%8e%e5%87%af%e5%ae%be%e9%a6%86",51Testing软件测试网 {)|P8f^"X(h.E\
  "Snapshot=t41.inf",
Y:uOn0O+C0  "Mode=HTTP",51Testing软件测试网1I6@B d ?5H F
  LAST);51Testing软件测试网_ I'TnC9K

/V+{!\ D1z,Z x1j0注意黑体字,被转化了的汉字,使用如下函数

-~} `#ZS0

7WbU_'A+{EBJ3bk,\0定义两个变量

2`])?H {P([a0

sz]fW%~A9N0    char temp;51Testing软件测试网(Lccl/k u.tk"?
    char hotelname[4096]; 

-e j u&Ul7u/k m:V051Testing软件测试网3s*]G2h7RI%vht5f

lr_convert_string_encoding(lr_eval_string("{hotel_name}"),LR_ENC_SYSTEM_LOCALE, LR_ENC_UTF8 ,"temp");51Testing软件测试网5R']FYV h ^

n;X6F Cn\&_0转化完的字符放到了temp里,

pq1f-\,q^ Ea1J051Testing软件测试网R9d'{rw!v9J

 strcat(hotelname,lr_eval_string ( "{temp}" ));

$eB FPH2h051Testing软件测试网N*D9CoY

web_url("0.00",
9zF#O?/SP3D0  "URL=http://192.168.0.15/xxx/xxx/xxx.aspx?HotelName={hotelname}",
6x6T:sa/mU?4v0  "Resource=0",
JY(K |t?0  "RecContentType=text/html",
v;fEM/bI2s0  "Referer=http://192.168.0.15/xxx/xxx/xxx.aspx?hotelid=00101210&hotelname=%e5%8c%97%e4%ba%ac%e5%8d%8e%e5%87%af%e5%ae%be%e9%a6%86",
]G*Y` h$Z-vj0  "Snapshot=t41.inf",51Testing软件测试网4O&aL,w%]J
  "Mode=HTTP",
7HC mYeJE?0  LAST);51Testing软件测试网j8J o%o't

51Testing软件测试网-O(OIW*`l

 51Testing软件测试网0S O'mX`n G

j"MQ9~1A*G?e-rT3LQ3O0 

A;`QIz4?0

TAG:

 

评分:0

我来说两句

我的栏目

日历

« 2024-04-26  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 3558
  • 日志数: 4
  • 建立时间: 2010-03-23
  • 更新时间: 2010-04-28

RSS订阅

Open Toolbar