<
%
function encode(soStr)
for i = 1 to len (soStr)
TempNum = hex ( asc ( mid (soStr,i, 1 )))
if len (TempNum) = 4 then
encode = encode & " % " & left ( cstr (TempNum), 2 ) & " % " & right ( cstr (TempNum), 2 )
else
Randomize
encode = encode & " % " & chr ( 72 + int ( rnd * 18 )) & chr ( 72 + int ( rnd * 18 )) & " % " & cstr (TempNum)
end if
next
endfunction
function decode(x)
x = replace (x, " % " , "" )
for i = 1 to len (x)
if asc ( mid (x,i, 1 )) >= 72 then
x = replace (x, mid (x,i, 1 ), " 0 " )
end if
next
for i = 1 to len (x)step 4
decode = decode & chr ( int ( " &H " & mid (x,i, 4 )))
next
endfunction
% >
function encode(soStr)
for i = 1 to len (soStr)
TempNum = hex ( asc ( mid (soStr,i, 1 )))
if len (TempNum) = 4 then
encode = encode & " % " & left ( cstr (TempNum), 2 ) & " % " & right ( cstr (TempNum), 2 )
else
Randomize
encode = encode & " % " & chr ( 72 + int ( rnd * 18 )) & chr ( 72 + int ( rnd * 18 )) & " % " & cstr (TempNum)
end if
next
endfunction
function decode(x)
x = replace (x, " % " , "" )
for i = 1 to len (x)
if asc ( mid (x,i, 1 )) >= 72 then
x = replace (x, mid (x,i, 1 ), " 0 " )
end if
next
for i = 1 to len (x)step 4
decode = decode & chr ( int ( " &H " & mid (x,i, 4 )))
next
endfunction
% >