urlencode cannot handle spaces in URL correctly?
am 10.01.2008 23:42:07 von gouqizi.lvchaFor 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 ASP.Net 2.0, if using HttpUtilities.Urlencode, it will encode
spaces as '+' rather than %20, is this a known issue or something
expected.
It's correct encoding.
Both %20 and + are correct.
go to Google.com enter "a b" and hit go. You will see folowing URL
http://www.google.com/search?hl=en&q=a+b
George.
news:db118b53-498a-46d4-a05b-6c693bc1d376@e23g2000prf.google groups.com...
> 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 =3D "some string"
a =3D a.replace(" ","SPACE")
coded =3D urlencode(a)
--- to read
b =3D urldecode(coded)
b =3D b.replace("SPACE"," ")
cause in my situation "SPACE" will never be passed in the url, so i
can safely use it
On Jan 11, 6:42=A0am, gouqizi.lv...@gmail.com wrote:
> 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.