Hi
I'm using this code to convert string to ISO8859-1
baseurl = "http://myurl.com/mypage.php"
client = New WebClient
client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)")
client.QueryString.Add("usuario", user)
client.QueryString.Add("password", pass)
client.QueryString.Add("ruta", 2)
client.QueryString.Add("remitente", Me.txtRemite.Text)
If Me.chkPRefijo.Checked = True Then
client.QueryString.Add("destinatarios", Me.LookUpEdit1.EditValue & Me.dtsMvl.Tables(0).Rows(x).Item("movil"))
Else
client.QueryString.Add("destinatarios", Me.dtsMvl.Tables(0).Rows(x).Item("movil"))
End If
textoSms = Me.mmTexto.Text
textoSms = System.Web.HttpUtility.UrlEncode(textoSms, System.Text.Encoding.GetEncoding("ISO-8859-1"))
client.QueryString.Add("mensaje", textoSms)
client.QueryString.Add("reporte", 1)
data = client.OpenRead(baseurl)
reader = New StreamReader(data)
s = reader.ReadToEnd()
data.Close()
reader.Close()
But the problem is when an user writes this caracter: +
EXAMPLE:
user writes in my app:
price 80+VAT
encoded string in my app and this string is sent to provider:
price+80%2bVAT
sms received in the mobile:
price 80 VAT
EDIT
Ineed to pass to URL some variables. Because I have a program to send sms, And I need to send variables to URL (URL provider SMS system). The string (message mobile that the user writes in my program) must be sent encoded (ISO 8859-1).
For example, this code in PHP runs fine:
$texto=urlencode($textoOriginal);
This code returns this string converted:
price+80%2BVAT
EDIT 2
I think that my code is wrong. Because if I send the same string encoded "price+80%2BVAT", Why in VB.NET code not runs and in PHP runs fine? Is the same encoded string.