I need to fully URL Encode an email address.
HttpUtility.UrlEncode seems to ignore certain characters such as ! and .
I need to pass an email address in a ur
Unless I am mistaken, URL Encoding is simply the percent sign followed by the ASCII number (in hex), so this should work...
Dim Encoded as New StringBuilder()
For Each Ch as Char In "something+me@example.com"
If Char.IsLetterOrDigit(Ch)
Encoded.Append(Ch)
Else
Encoded.Append("%")
Dim Byt as Byte = Encoding.ASCII.GetBytes(Ch)(0)
Encoded.AppendFormat("{0:x2}", Byt)
End If
Next
The above code results in something%2Bme%40example.com