Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > urlencode cannot handle spaces in URL correctly?

Reply
Thread Tools

urlencode cannot handle spaces in URL correctly?

 
 
gouqizi.lvcha@gmail.com
Guest
Posts: n/a
 
      01-10-2008
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.

 
Reply With Quote
 
 
 
 
George Ter-Saakov
Guest
Posts: n/a
 
      01-10-2008
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.

<> wrote in message
news:db118b53-498a-46d4-a05b-...
> 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.
>



 
Reply With Quote
 
 
 
 
zzzxtreme@gmail.com
Guest
Posts: n/a
 
      01-11-2008
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

On Jan 11, 6:42*am, 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How to trim a String trailing spaces, but not leading spaces? Roedy Green Java 3 09-14-2008 02:10 AM
Re: How to trim a String trailing spaces, but not leading spaces? John B. Matthews Java 4 09-12-2008 05:28 AM
building a URL dynamically and URLEncode? DC Gringo ASP .Net 1 11-23-2004 05:01 AM
asp server.UrlEncode VS asp.net Server.UrlEncode Vs Php urlencode Dario Sala ASP .Net 1 11-15-2004 11:27 PM
Difference between System.Web.HttpUtility.UrlEncode and Server.UrlEncode? Andreas Klemt ASP .Net 4 01-22-2004 01:35 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57