-1

I googled it, and came up with:

http://www.w3schools.com/tags/ref_urlencode.asp

The origin on why '%20' is used as a space in URLs

URL encoding the space character: + or %20?

http://www.blooberry.com/indexdot/html/topics/urlencoding.htm

and it appears to be part of an RFC spec. but not part of any language spec.

Maybe it is JavaScript. I don't know.

Is this true?

Community
  • 1
  • 1

2 Answers2

1

URL encodings are not specifically a part of the spec of any programming language, it's a RFC standard. However, URL encoding functions are available in almost all major programming languages. A non-exhaustive list of URL encoding functions in various languages:

  • JavaScript: use encodeURIComponent for encoding a normal string, and encodeURI for encoding a full address. See here for more information.
  • Python 2: urllib.quote
  • Python 3: urllib.parse.quote
  • PHP: urlencode
  • Java: java.net.URLEncoder.encode
  • Ruby: CGI.escape
Community
  • 1
  • 1
Luke Taylor
  • 8,631
  • 8
  • 54
  • 92
  • 1
    javascript one is `encodeURIComponent`with a lower cased `e`. Also it's for uri parameters encoding. For url encoding, one should prefer `encodeURI`. [more info](http://stackoverflow.com/questions/75980/when-are-you-supposed-to-use-escape-instead-of-encodeuri-encodeuricomponent) – Kaiido Jun 30 '16 at 01:09
0

See the URL standard in general and the Percent-encoded bytes section in particular.

Marat Tanalin
  • 13,927
  • 1
  • 36
  • 52