urlencode 发送表单
我有一个简单的搜索表单,
<form id="search" name="search" method="GET" action="search.php" enctype="application/x-www-form-urlencoded">
但是此表单不会对 URL 中的所有字符进行编码,'
不会编码为 %27
,这不应该自动完成吗?
I have a simple search form
<form id="search" name="search" method="GET" action="search.php" enctype="application/x-www-form-urlencoded">
But this form doesn't encode all chars in a URL, '
isn't encoded to %27
, shouldn't this be done automatically?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这很有趣。在 HTML 规范中,它规定所有非字母数字字符均由 %HH 表示(根据 RFC 1738,第 2.2 节)。但如果你真的去查看 RFC1738,第 2.2 节有以下内容:
但 Chrome 似乎严格遵循了该规范,而 IE 和 Firefox 选择不对这些字符进行编码。
This is rather funny.. On the HTML specification it states that all Non-alphanumeric characters are represented by %HH (according to RFC 1738, Section 2.2). But if you actually go to the RFC1738, Section 2.2 has the following:
But Chrome seems to follow the specification to the letter, where as IE and Firefox choose to not encode those characters..