Scrapbook/개발 및 프로그래밍

[ASP] URLDecode

가을이짱짱 2004. 7. 27. 17:52
반응형
[CODE]Function URLDecode(Expression) Dim strSource, strTemp, strResult, strchr Dim lngPos, AddNum, IFKor strSource = Replace(Expression, "+", " ") For lngPos = 1 To Len(strSource) AddNum = 2 strTemp = Mid(strSource, lngPos, 1) If strTemp = "%" Then If lngPos + AddNum < Len(strSource) + 1 Then strchr = CInt("&H" & Mid(strSource, lngPos + 1, AddNum)) If strchr > 130 Then AddNum = 5 IFKor = Mid(strSource, lngPos + 1, AddNum) IFKor = Replace(IFKor, "%", "") strchr = CInt("&H" & IFKor ) End If strResult = strResult & Chr(strchr) lngPos = lngPos + AddNum End If Else strResult = strResult & strTemp End If Next URLDecode = strResult End Function [/CODE]
반응형