XMLHTTP反回中文乱码问题
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>
您可能感兴趣的文章:
XMLHTTP反回中文乱码问题
js之ActiveX控件使用说明 new ActiveXObject()
ajax页面乱码与get post乱码的解决
php截取中文字符串乱码如何解决呢
php分割GBK中文乱码的解决方法
ajax asp的二级联动菜单实例
PHP如何使用strrev()函数反转字符串?(代码示例)
php网页标题中文乱码如何解决
Ajax 数据请求的简单分析
ajax 注册验证