urlencode, decode minor mistakes

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Post Reply
sweet40
Posts: 84
Joined: 21 Apr 2013 22:16

urlencode, decode minor mistakes

Post 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.

admin
Site Admin
Posts: 67315
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: urlencode, decode minor mistakes

Post by admin »

What's the difference between RFC 1738 and RFC 3986?

sweet40
Posts: 84
Joined: 21 Apr 2013 22:16

Re: urlencode, decode minor mistakes

Post 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? >>>>>>>)

admin
Site Admin
Posts: 67315
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: urlencode, decode minor mistakes

Post by admin »

Thank you! :D

40k
Posts: 234
Joined: 09 Dec 2011 21:25

Re: urlencode, decode minor mistakes

Post 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
I develop scripts that integrate media functionality into Xyplorer.
Hash - Twitch.tv in VLC (NEW 2.0!) - FFmpeg GUI - Youtube downloading
XYplorer for Linux! Tutorial

admin
Site Admin
Posts: 67315
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: urlencode, decode minor mistakes

Post by admin »

This is the function:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

Apparently ":" is not considered unsafe.

Post Reply