dim i dim strReturn,ThisChr,innerCode,Hight8,Low8

strReturn = "" for i = 1 to Len(vstrIn) ThisChr = Mid( " /> 狠狠v欧美v日韩v亚洲ⅴ,日韩高清在线不卡,av资源在线

色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

轉(zhuǎn)換中文為unicode 轉(zhuǎn)換unicode到正常文本

復(fù)制代碼 代碼如下:
'//轉(zhuǎn)換中文為unicode
function URLEncoding(vstrIn)

    dim i
    dim strReturn,ThisChr,innerCode,Hight8,Low8

    strReturn = ""
    for i = 1 to Len(vstrIn)
        ThisChr = Mid(vStrIn,i,1)
        If Abs(Asc(ThisChr)) < &HFF then
            strReturn = strReturn & ThisChr
        else
            innerCode = Asc(ThisChr)
            If innerCode < 0 then
                innerCode = innerCode + &H10000
            end If
            Hight8 = (innerCode  and &HFF00)/ &HFF
            Low8 = innerCode and &HFF
            strReturn = strReturn & "%" & Hex(Hight8) &  "%" & Hex(Low8)
        end If
    next

    URLEncoding = strReturn

end function

'//轉(zhuǎn)換unicode到正常文本
function bytes2BSTR(vIn)
    dim i
    dim strReturn,ThisCharCode,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
    bytes2BSTR = strReturn

end function

function getText(oReq,url)

    on error resume next
    '//創(chuàng)建XMLHTTP對(duì)象    
    if oReq is nothing then
        set oReq    = CreateObject("MSXML2.XMLHTTP")
    end if

    if    not oReq is nothing then
        oReq.open "get",url,false
        oReq.send 

        if oReq.status = 200 then
            getText = bytes2BSTR(oReq.responseBody)
        else
            getText = ""
        end if
    else
        getText = ""
    end if

end function

php技術(shù)轉(zhuǎn)換中文為unicode 轉(zhuǎn)換unicode到正常文本,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 枞阳县| 汨罗市| 濉溪县| 宜昌市| 江川县| 耒阳市| 泌阳县| 清水县| 开鲁县| 宁阳县| 台东市| 开原市| 石渠县| 巨鹿县| 云龙县| 原平市| 容城县| 恩施市| 平潭县| 盐亭县| 景谷| 阿克| 裕民县| 蒙自县| 墨竹工卡县| 宾川县| 南溪县| 天长市| 汪清县| 门头沟区| 望奎县| 华亭县| 宾阳县| 罗定市| 莎车县| 贵溪市| 新巴尔虎右旗| 平遥县| 东乡| 临猗县| 台安县|