国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

轉換中文為unicode 轉換unicode到正常文本

2024-05-04 10:59:04
字體:
來源:轉載
供稿:網友

復制代碼 代碼如下:

'//轉換中文為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

'//轉換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
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 杭州市| 建始县| 馆陶县| 青川县| 通许县| 罗甸县| 九江县| 衢州市| 靖江市| 兰州市| 全南县| 甘德县| 兰考县| 太仆寺旗| 伊吾县| 青阳县| 绥宁县| 汉川市| 同江市| 富裕县| 乐亭县| 湄潭县| 安化县| 鄯善县| 武川县| 华坪县| 泸定县| 汾西县| 长汀县| 古浪县| 太谷县| 平舆县| 荣昌县| 保山市| 应用必备| 宁武县| 扶沟县| 塘沽区| 亳州市| 皮山县| 漠河县|