Cita:
Empezado por ermendalenda
Código:
Codigo_uri=TEXT_TO_codigo_uri(texto_origen)
FUNCTION TEXT_TO_codigo_uri(bufo)
For a = 1 To Len(bufo)
sql_buff = Mid(bufo, a, 1)
sql_buff = LTrim(Hex(Asc(sql_buff)))
If Len(sql_buff) = 1 Then
sql_buff = "0" & sql_buff
End If
TEXT_TO_codigo_uri = TEXT_TO_codigo_uri & "%" & sql_buff
Next
END FUNCTION
|
Con .Net se hace con una línea (
https://docs.microsoft.com/en-us/dot...capedatastring):
Código:
private string GetURLEncodedString(string inputString)
{
string result = Uri.EscapeDataString(inputString);
return result;
}