lr_convert_string_encoding函数的使用

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

3Q#v#dx v%}m0由于url不能传输汉字,所以程序要把汉字转换一下,lr怎么参数化呢51Testing软件测试网6z9\tVD(HH

km/~g{ U0看下面的列子

0]~jG$nL051Testing软件测试网 B8wW+z/Ko

 web_url("0.00",51Testing软件测试网J Y2qtcY
  "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软件测试网g$_na^#ZG0@\h? Y
  "Resource=0",
K1iXmd4b iB:Ri |0  "RecContentType=text/html",
R,pXGB!w^&o!|0  "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软件测试网FO]0a%K j4I+\u$m
  "Snapshot=t41.inf",
#@+dL^x:oC/O.B;H;q4O0  "Mode=HTTP",
P*e:?J!f0td&`0  LAST);51Testing软件测试网h N#IwyeY

51Testing软件测试网-i&s#Sy+\2P_c I

注意黑体字,被转化了的汉字,使用如下函数

4[3Y ]Z8DyG E"A!d051Testing软件测试网H-_)Fdv V/e

定义两个变量

L$vv+G3y051Testing软件测试网^N,q-wzGK@

    char temp;
^'?2I`'LUm|+\ m6r0    char hotelname[4096]; 51Testing软件测试网#x j.]$w_rm-v

51Testing软件测试网fMj.Z(U

lr_convert_string_encoding(lr_eval_string("{hotel_name}"),LR_ENC_SYSTEM_LOCALE, LR_ENC_UTF8 ,"temp");51Testing软件测试网,o"RhB/P6ixW+i'HvQ'n

8pRff_P5K3o0转化完的字符放到了temp里,51Testing软件测试网 j(Zr6QnR9_

J;V7l {V U2h&pwq6a_0 strcat(hotelname,lr_eval_string ( "{temp}" ));51Testing软件测试网:k&{)gol/n

P!ztK"xA+UY/Y0web_url("0.00",51Testing软件测试网 tY#_3FVo
  "URL=http://192.168.0.15/xxx/xxx/xxx.aspx?HotelName={hotelname}",51Testing软件测试网lp&Oa"f&\8L@7m
  "Resource=0",51Testing软件测试网8[_5c{\oZ:[/[2U%\
  "RecContentType=text/html",51Testing软件测试网K]"zR)S [2K6L
  "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软件测试网7d(Kl'}1[Qz)ZI*e
  "Snapshot=t41.inf",
}v1S`1t0  "Mode=HTTP",51Testing软件测试网T q RHx%}$`
  LAST);

6UL[b@#J0

"jl?N1An I0 51Testing软件测试网h#?U,J#a `.B'X@

51Testing软件测试网XjsI Hn)X.`R

 51Testing软件测试网 fj\cA{+ZMN)R


TAG:

 

评分:0

我来说两句

我的栏目

日历

« 2024-05-11  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

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

RSS订阅

Open Toolbar