lr_convert_string_encoding函数的使用
上一篇 /
下一篇 2010-04-27 11:04:52 / 天气: 晴朗
/ 心情: 高兴
/ 个人分类:lr
51Testing软件测试网'O$x)A3~s0I由于url不能传输汉字,所以程序要把汉字转换一下,lr怎么参数化呢
yd'G^M1M7h3j02g1vyUhIC?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注意黑体字,被转化了的汉字,使用如下函数
-~}`#ZS07WbU_'A+{EBJ3bk,\0定义两个变量
2`])?H {P([a0s z]fW%~A9N0 char temp;51Testing软件测试网(Lccl/k
u.tk"?
char hotelname[4096];
-eju&Ul7u/k m:V051Testing软件测试网3s*]G2h7RI%vht5flr_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}" ));
$eBFPH2h051Testing软件测试网N*D9CoYweb_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",
7HCmYeJE?0 LAST);51Testing软件测试网j8J
o%o't
51Testing软件测试网-O(OIW*`l 51Testing软件测试网0SO'mX`n G
j"M Q9~1A*G?e-rT3LQ3O0
A;`QIz4?0
收藏
举报
TAG: