XMLHTTP反回中文乱码问题:
方法一php
header("Content-type:html/text;charset=utf-8");
方法二asp
response.charset='gbk';
方法三,用asp是才用.
<script language="VBScript">
Function bdBytes2Str(vIn)
dim strReturn
dim i
dim ThisCharCode
dim NextCharCode
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bdBytes2Str = strReturn
End Function
</script>
时间: 2024-11-01 08:39:32