指引网

当前位置: 主页 > 编程开发 > ASP >

XMLHTTP反回中文乱码问题

来源:网络 作者:佚名 点击: 时间:2017-08-23 21:42
[摘要] 指引教程为您提供XMLHTTP反回中文乱码问题等资源,欢迎您收藏本站,我们将为您提供最新的XMLHTTP反回中文乱码问题资源
<script>ec(2);</script>

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>

------分隔线----------------------------