I\'m working on a data transfer for a gateway which requires me to send data in UrlEncoded form. However, .net\'s UrlEncode creates lowercase tags, and it breaks the transfe
This is the code that I'm using in a Twitter application for OAuth...
Public Function OAuthUrlEncode(ByVal value As String) As String
Dim result As New StringBuilder()
Dim unreservedChars As String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~"
For Each symbol As Char In value
If unreservedChars.IndexOf(symbol) <> -1 Then
result.Append(symbol)
Else
result.Append("%"c + [String].Format("{0:X2}", AscW(symbol)))
End If
Next
Return result.ToString()
End Function
Hope this helps!