Function UrlEncode(strTarget As String) As String
Dim obj As Object
Dim s As String
If Len(strTarget) = 0 Then Exit Function
Set obj = CreateObject("ScriptControl")
obj.Language = "JScript"
s = obj.CodeObject.encodeURIComponent(strTarget)
'エンコードされないので文字の対策
s = Replace(s, "(", "%28") '(
s = Replace(s, ")", "%29") ')
s = Replace(s, "!", "%21") '!
UrlEncode = s
End Function
手抜きまくってます・・・。
0 件のコメント:
コメントを投稿