space in url; did browser got smarter or server?

后端 未结 1 1248
没有蜡笔的小新
没有蜡笔的小新 2021-01-22 00:25

It looks like today you no longer to have to encode spaces by %20 in your html links or image links. For example, suppose you have this image at 〔http://example.com/i/my house.j

相关标签:
1条回答
  • 2021-01-22 00:39

    The browser makes the correction.

    You still have to encode the spaces though. Just because it works in the browsers you use doesn't make it valid, and doesn't mean it will work everywhere.

    You can see a list of reserved characters and other characters that should be encoded here: http://www.blooberry.com/indexdot/html/topics/urlencoding.htm

    RFC1738 specifically states:

    Thus, only alphanumerics, the special characters "$-_.+!*'(),", and reserved characters used for their reserved purposes may be used unencoded within a URL.

    RFC2396 takes place over RFC1738 and expounds on space usage in URLs:

    The space character is excluded because significant spaces may disappear and insignificant spaces may be introduced when URI are transcribed or typeset or subjected to the treatment of word- processing programs. Whitespace is also used to delimit URI in many contexts.

    0 讨论(0)
提交回复
热议问题