Page 1 of 1

urlencode, decode minor mistakes

Posted: 29 Apr 2013 02:29
by sweet40
encode/decode can't be rfc 1738 like in
0: URL-encode according to RFC 1738;
will convert " " (space) to "+"
1: URL-encode according to RFC 1738;
will NOT convert " " (space) to "+" (but to "%20")

as it was obsoleted by RFC 3986?
can't find a better article than
http://stackoverflow.com/questions/4979 ... ce-in-them
currently, sorry.

Re: urlencode, decode minor mistakes

Posted: 29 Apr 2013 07:48
by admin
What's the difference between RFC 1738 and RFC 3986?

Re: urlencode, decode minor mistakes

Posted: 29 Apr 2013 09:54
by sweet40
http://tools.ietf.org/html/rfc1738
3.4.7 Referring to specific Gopher+ attributes

http://tools.ietf.org/html/rfc3986
2.5. Identifying Data

(both are extensive, so other mentions will be found)


http://stackoverflow.com/questions/9961 ... wurlencode
urlencode differs from RFC 1738 by encoding spaces as + instead of %20
...
urlencode - based only legacy implementation converts spaces to +
rawurlencode - based on RFC 1738 translates spaces to %20

so help file should read

urlencode()
...
0: URL-encode according to RFC 3986;
will convert " " (space) to "+"

1: URL-encode according to RFC 1738;
will NOT convert " " (space) to "+" (but to "%20")


urldecode()
...
0: URL-decode according to RFC 3986;
will convert "+" to " " (space)

1: URL-decode according to RFC 1738;
will NOT convert "+" to " " (space) (<<<<<< mention for %20? >>>>>>>)

Re: urlencode, decode minor mistakes

Posted: 29 Apr 2013 11:43
by admin
Thank you! :D

Re: urlencode, decode minor mistakes

Posted: 29 Apr 2013 15:43
by 40k
admin wrote:Thank you! :D
While we're at it: is there any reason why urlencode() does not change

Code: Select all

:
to

Code: Select all

%3A

Re: urlencode, decode minor mistakes

Posted: 29 Apr 2013 15:51
by admin
This is the function:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

Apparently ":" is not considered unsafe.