HTTP URI 可以包含非 ASCII 字符吗?

发布于 2024-08-26 07:05:10 字数 487 浏览 12 评论 0原文

我尝试在相关 RFC IETF RFC 3986 中找到此内容,但无法找到算一下。

HTTP 的 URI 是否允许 Unicode 或任何类型的非 ASCII?

您能否引用支持您答案的部分和 RFC?

注意:对于那些可能认为这与编程无关的人来说 - 事实确实如此。它与我正在构建的 ISAPI 过滤器相关。


附录

我已经阅读了 RFC 3986 的第 2.5 节。但是 RFC 2616(我认为是当前的 HTTP 协议)早于 3986,并且出于这个原因,我认为它不能符合 3986。此外,即使或当 HTTP RFC 更新时,仍然存在合理化问题 - 换句话说,HTTP URI 是否支持所有RFC3986 附带条件,包括任何适合包含非 US-ASCII 字符的内容?

I tried to find this in the relevant RFC, IETF RFC 3986, but couldn't figure it.

Do URIs for HTTP allow Unicode, or non-ASCII of any kind?

Can you please cite the section and the RFC that supports your answer.

NB: For those who might think this is not programming related - it is. It's related to an ISAPI filter I'm building.


Addendum

I've read section 2.5 of RFC 3986. But RFC 2616, which I believe is the current HTTP protocol, predates 3986, and for that reason I'd suppose it cannot be compliant with 3986. Furthermore, even if or when the HTTP RFC is updated, there still will be the issue of rationalization - in other words, does an HTTP URI support ALL of the RFC3986 provisos, including whatever is appropriate to include non US-ASCII characters?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

无需解释 2024-09-02 07:05:10

不,他们是不允许的。只需检查 RFC 3986 中的 ABNF 即可。

No, they are not allowed. Just check the ABNF in RFC 3986.

秉烛思 2024-09-02 07:05:10

这是一个例子:☃.net。

就 RFC 3986 的相关部分而言,我认为您正在查看 2.5< /a>.

编辑:

显然堆栈溢出不会将其检测为正确的 URL。您必须复制并粘贴到浏览器中。

Here is an example: ☃.net.

In terms of the relevant section of RFC 3986, I think you are looking at 2.5.

EDIT:

Apparently stack overflow doesn't detect this as a proper URL. You'll have to copy&paste into your browser.

呆° 2024-09-02 07:05:10

过去,DNS 和 URL/URI 中不允许使用非英文字符。有一个黑客可以通过在 URI 中使用 % 编码来允许它们。然而,美国、俄罗斯和中国等许多国家开始使用非拉丁字符实施 DNS。以下是对其中一项标准的引用

Used to be that non english characters were not allowed in DNS and URL/URI. There was a hack to allow them by using % encoding in URI. However many countries such us russia and china are starting to implement DNS using non latin characters. Here is a reference to one of these standards

千柳 2024-09-02 07:05:10

RFC 3986 正在被 RFC 3987 取代,RFC 3987 完全支持 Unicode,并提供与 RFC 3986 样式 URI 之间的映射规则。

RFC 3986 is being replaced with RFC 3987, which fully supports Unicode, and provides mappings rules to/from RFC 3986 style URIs.

野心澎湃 2024-09-02 07:05:10

许多浏览器不支持带有 Unicode 字符的 URI(我已经在我构建的名为 blogvani.com 的网站上实现了它们),并且 Google 会及时扫描并保持它们完整。但我认为这不适用于顶级域名,至少不适用于注册商,而且不能直接使用。

对于顶级域名,如果您有一个以 Unicode 注册的域名(例如人们可以以印地语注册域名),它将被转换为相应的 ASCII 代码(可能类似于 jdhfks3243-32434.com)

...很有趣的是看到它是如何路由的,并意识到你实际上并没有进入 unicode 域,尽管看起来是这样。

Many browsers are not support URIs with Unicode characters (I've implemented them on a website I've build called -- blogvani.com) and Google duly scans and keeps them intact. I don't think that works on top-level domains though, at least not with the registrar and not directly.

For top-level domains if you have a domain registered in Unicode (for example people can register domains in Hindi), it will be converted to a corresponding code in ASCII (something that may go like jdhfks3243-32434.com)...

It is quite funny to see how this is routed and to realize that you're not actually going to a unicode domain even though it seems like that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文