龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > asp编程 >

XMLHTTP反回中文乱码问题

时间:2012-12-31 22:56来源:未知 作者:admin 点击:
分享到:
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 ThisCharC

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>


精彩图集

赞助商链接