urlencode cannot handle spaces in URL correctly?

  • Thread starter Thread starter gouqizi.lvcha
  • Start date Start date
G

gouqizi.lvcha

For ASP.Net 2.0, if using HttpUtilities.Urlencode, it will encode
spaces as '+' rather than %20, is this a known issue or something
expected.
 
for characters like that, i replace as something else first, then
encode, and when after i decode i replace back

like this

a = "some string"

a = a.replace(" ","SPACE")

coded = urlencode(a)


--- to read

b = urldecode(coded)
b = b.replace("SPACE"," ")


cause in my situation "SPACE" will never be passed in the url, so i
can safely use it
 
Back
Top