VB 问题,通过XMLHTTP传递中文到编码为UTF-8的ASP页面出现乱码

来源:百度知道 编辑:UC知道 时间:2024/06/30 12:07:00
Sub xmlhttps(strUrl)
Set xmlobject = CreateObject("Microsoft.XMLHTTP")
xmlobject.open "GET", strUrl, True
xmlobject.send
End Sub

VB中用上面过程传递中文到编码为UTF-8的ASP页面,中文部分出现乱码。
本来JavaScript中可以用Escape进行处理的,但是VB中却没有这个函数。

请高手指教,如何处理才能解决此中文乱码问题呢?
乱码的原因,应是UTF-8不允许用URL传递中文的原因。

哪位高手解决VB中URL传递中文的问题,此问题就可以解决了。

Set xmlobject = CreateObject("Microsoft.XMLHTTP")
xmlobject.setRequestHeader "Content-Type", "application/x-www-form-urlencoded;charset=utf-8" '加上这一句试试
xmlobject.open "GET", strUrl, True
xmlobject.send

Sub xmlhttps(strUrl)
Set xmlobject = CreateObject("Microsoft.XMLHTTP")
xmlobject.setRequestHeader "Content-Type", "application/x-www-form-urlencoded;charset=utf-8" '加上这一句试试
xmlobject.open "GET", strUrl, True
xmlobject.send
End Sub

你在你的ASP页开头加上一句:response.charset=utf-8" 试试

不要用xmlhttp,用wsk或者inet