asp下实现UrlEncoding转换编码的代码
时间:2019-10-09 14:28 来源/作者:asp代码网
-
'==================================================
-
'函数名:UrlEncoding
-
'作 用:转换编码
-
'==================================================
-
Function UrlEncoding(DataStr)
-
Dim StrReturn,Si,ThisChr,InnerCode,Hight8,Low8
-
StrReturn = ""
-
For Si = 1 To Len(DataStr)
-
ThisChr = Mid(DataStr,Si,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
相关文章
热门资讯