有关给utf-8的页面通过URL传递信息的问题
这是快钱的支付网关,如下面的地址:
https://www.99bill.com/webapp/receiveMerchantInfoAction.do?merchant_id=88990607152012539&orderid=20067211422500&amount=10&merchant_url=http://www.500word.com.cn/ok.html&pname=姓名&commodity_info=商品信息&pemail=supfree@eyou.com&merchant_key=1112223334445556
其中pname与commodity_info的值是中文,而接收页https://www.99bill.com/webapp/receiveMerchantInfoAction.do是utf-8编码的页面,因此最后得到的页面中,传递的中文显示为乱码。
请问该如何对此url进行编码?进行何种编码?以使得到的页面不显示乱码呢?
问题点数:100、回复次数:4Top
1 楼net_lover(【孟子E章】)回复于 2006-07-02 13:13:50 得分 0
str = "https://www.99bill.com/webapp/receiveMerchantInfoAction.do?merchant_id=88990607152012539&orderid=20067211422500&amount=10&merchant_url=http://www.500word.com.cn/ok.html&pname=" & Server.UrlEncode("姓名") & "&commodity_info=" & Server.UrlEncode("商品信息") & "&pemail=supfree@eyou.com&merchant_key=1112223334445556
Top
2 楼net_lover(【孟子E章】)回复于 2006-07-02 13:14:11 得分 0
str = "https://www.99bill.com/webapp/receiveMerchantInfoAction.do?merchant_id=88990607152012539&orderid=20067211422500&amount=10&merchant_url=http://www.500word.com.cn/ok.html&pname=" & Server.UrlEncode("姓名") & "&commodity_info=" & Server.UrlEncode("商品信息") & "&pemail=supfree@eyou.com&merchant_key=1112223334445556"
Top
3 楼liulangpaimai2(sdfds)回复于 2006-07-02 14:05:14 得分 0
楼上,我试过了,还是不行,编码后的地址是:
https://www.99bill.com/webapp/receiveMerchantInfoAction.do?merchant_id=88990607152033567&orderid=2006721444600&amount=10&merchant_url=http://www.500word.com.cn/ok.html&pname=%B3%C6%BA%F4&commodity_info=%B9%D8%BC%FC%B4%CA&pemail=supfree@eyou.com&merchant_key=1111222233334444
但是打开后仍然是乱码Top
4 楼wtogether(wtogether)回复于 2006-07-02 19:17:19 得分 0
str = "https://www.99bill.com/webapp/receiveMerchantInfoAction.do?merchant_id=88990607152012539&orderid=20067211422500&amount=10&merchant_url=http://www.500word.com.cn/ok.html&pname=" & UrlEncode8("姓名") & "&commodity_info=" & UrlEncode8("商品信息") & "&pemail=supfree@eyou.com&merchant_key=1112223334445556"
URLEncode8函数详细参考http://community.csdn.net/Expert/TopicView3.asp?id=4703018自己编写一个Top




