I’m trying to encode the following string using HttpUtility.UrlEncode;
1:7:1:0:0:0:0:0:0:0:FROM BOUQUET "userbouquet.dbe01.tv" ORDER BY bouquet
The result i get is;
1%3a7%3a1%3a0%3a0%3a0%3a0%3a0%3a0%3a0%3aFROM+BOUQUET+%22userbouquet.dbe0e.tv%22+ORDER+BY+bouquet
So it’s converting : to %3a, a space to + and ” to %22. According to the documentation on MSDN, : shouldn’t be converted. Also i don’t understand why a space is being converted to a plus, i thought it should of been a %20.
Any information on what’s going on and any possible workarounds?
Note: : should be left as is, a space should be %20 and ” should be %22
EDIT: I’ve found a solution using a simple string replace function, but if someone could still explain why urlencode behaves in this way. Thanks
+is a reserved URL character that as its intended purpose represents space, so that translation is legal.:is a reserved character, but isn’t being used in the intended purpose way here (AFAIK), so percent-encoding is appropriate."is neither reserved nor unreserved (i.e. alphanumeric etc), so percent-encoding is the only option