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
  • 208,592
  • 21
  • 221
  • 278
Sperick
  • 2,557
  • 6
  • 28
  • 52
  • 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,653
  • 4
  • 43
  • 81