From: http://blog.163.com/dingpeng_2002/blog/static/18074646201021710530174/ hereby thanks
Function vbsescape (STR)
Dim I, S, C,
S = ""
For I = 1 to Len (STR)
C = mid (STR, I, 1)
A = ASCW (c)
If (A> = 48 and A <= 57) or (A> = 65 and A <= 90) or (A> = 97 and A <= 122) then
S = S & C
Elseif instr ("@ * _ +-./", c)> 0 then
S = S & C
Elseif a> 0 and a <16 then
S = S & "% 0" & hex ()
Elseif A> = 16 and a <256 then
S = S & "%" & hex ()
Else
S = S & "% u" & hex ()
End if
Next
Vbsescape = s
End Function
Function vbsunescape (STR)
Dim I, S, C
S = ""
For I = 1 to Len (STR)
C = mid (STR, I, 1)
If mid (STR, I, 2) = "% u" and I <= Len (STR)-5 then
If isnumeric ("& H" & Mid (STR, I + 2, 4) then
S = S & chrw (CINT ("& H" & Mid (STR, I + 2, 4 )))
I = I + 5
Else
S = S & C
End if
Elseif c = "%" and I <= Len (STR)-2 then
If isnumeric ("& H" & Mid (STR, I + 1, 2) then
S = S & chrw (CINT ("& H" & Mid (STR, I + 1, 2 )))
I = I + 2
Else
S = S & C
End if
Else
S = S & C
End if
Next
Vbsunescape = s
End Function