HTTP 标头可以本地化吗?

发布于 2024-12-27 16:25:15 字数 281 浏览 4 评论 0原文

HTTP Accept 标头可以使用 q 说明符指定优先级,例如

application/xml;q=0.8

我查看了 RFC,但可以看到任何提及 q 说明符是否受本地化或不是。例如,如果相应设置了 Accept-Language,欧洲浏览器是否可以将数字发送为 q=0,8

如果没有,一定有一些文档指定 HTTP 使用句点符号,并且我猜其标头中的文化不变?

The HTTP Accept header can specify priority using the q specifier, such as

application/xml;q=0.8

I had a look in the RFC but could see any mention of whether the q specifier is subject to localization or not. For instance, could a European browser send the figure as q=0,8 instead if the Accept-Language was set accordingly?

If not, there must be some documentation somewhere that specifies that HTTP uses the period notation and is culture invariant in its headers I guess?

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

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

发布评论

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

评论(2

咋地 2025-01-03 16:25:15

第 3.9 节 /www.w3.org/Protocols/rfc2616/rfc2616.html" rel="nofollow">RFC-2616 (HTTP/1.1 规范)将质量值(在示例中分配给“q”的值)定义为:

qvalue         = ( "0" [ "." 0*3DIGIT ] )
               | ( "1" [ "." 0*3("0") ] )

因此所有 HTTP 应用程序都必须使用小数点,而不是逗号或其他任何内容,无论它们位于世界何处。

Section 3.9 of RFC-2616 (the HTTP/1.1 spec) defines a Quality Value (the value assigned to 'q' in your example) as:

qvalue         = ( "0" [ "." 0*3DIGIT ] )
               | ( "1" [ "." 0*3("0") ] )

so all HTTP applications must use a decimal point, not a comma or anything else, regardless of where in the world they reside.

看轻我的陪伴 2025-01-03 16:25:15

技术协议总是与文化无关的——它是技术性的,而不是美国的或其他什么的。当然,您无法本地化 HTTP 标头中的任何内容。您也不能通过将标头字段翻译为运行或编写浏览器的国家/地区使用的语言来本地化标头字段。

A technical protocol is always culture-independent - it's technical, not American or anything. Of course you can not localize anything in a HTTP header. You can also not localize the header fields by translating them to the language that it is used in the country the browser is run or written in.

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