Group Abstract Group Abstract

Message Boards Message Boards

2
|
11.4K Views
|
0 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Should URLEncode convert whitespace to "%20" or "+"?

Posted 10 years ago

RFC 3986 specifies that URIs should use percent encoding (%20) for space characters

http://tools.ietf.org/html/rfc3986#section-2.1

The Mathematica URLEncode function is documented as "converts into a URL-style, percent-encoded ASCII string"

https://reference.wolfram.com/language/ref/URLEncode.html

It seems that "+" is only valid as an encoding for a space in the form data part of a URL. For details see

http://stackoverflow.com/questions/2678551/when-to-encode-space-to-plus-or-20

Therefore, the URLQueryEncode might be expected to convert spaces to plus signs however URLEncode should be converting spaces to "%20."

If this is an accurate interpretation of the specifications then it seems URLEncode has a bug in how it encodes spaces.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard