1

I'm trying to encode a query string using the HttpUtility.UrlEncode method

The string is:

www.example.come?a=1&b='mia'&c=33

the output is:

www.example.come%3fa%3d1%26b%3d'mia'%26c%3d33

Why did the quotation marks not get encoded and is there a way for me to ensure that they do?

Steve
  • 213,761
  • 22
  • 232
  • 286
Sperick
  • 2,691
  • 6
  • 30
  • 55
  • 1
    Maybe because `'` is a valid URL character (?) http://stackoverflow.com/questions/1547899/which-characters-make-a-url-invalid – apocalypse Jul 06 '16 at 12:30
  • Weird, _HttpUtility.UrlEncode("www.example.come?a=1&b='mia'&c=33)_ returns _www.example.come%3fa%3d1%26b%3d%27mia%27%26c%3d33_ here – Steve Jul 06 '16 at 12:32

1 Answers1

2

These characters are valid for URL according to this ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~:/?#[]@!$&'()*+,;=

Community
  • 1
  • 1
Gayan
  • 2,750
  • 5
  • 47
  • 88