permet de retrouver les fonctions javascript escape() et unescape()
Source / Exemple :
Public Function Unescape(ByVal str As String) As String
out = ""
If Len(str) > 0 Then
str = Replace(str, "+", " ")
I = 1
Do While I <= Len(str)
If Mid(str, I, 1) = "%" Then
Cod = Mid(str, I + 1, 2)
If Len(Cod) = 2 Then
out = out & Chr(CInt("&H" & Cod))
I = I + 3
Else
out = out & Mid(str, I, 1)
I = I + 1
End If
Else
out = out & Mid(str, I, 1)
I = I + 1
End If
Loop
End If
Unescape = out
End Function
Public Function Escape(ByVal str As String) As String
strNocode = "*+-./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz"
out = ""
If Len(str) > 0 Then
str = Replace(str, " ", "+")
For I = 1 To Len(str)
Car = Mid(str, I, 1)
If InStr(strNocode, Car) Then
out = out & Car
Else
out = out & "%" & Hex(Asc(Car))
End If
Next I
End If
Escape = out
End Function
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.