Accept-Language 标头的典型中文语言代码是什么? [英] What is the typical Chinese language code for the Accept-Language header?
问题描述
很遗憾,我无法亲自检查,所以我想向社区询问.
Unfortunately, I have no way to check this personally, so I wanted to ask the community about it.
根据RFC 5646,中文可以有如下表示:zh-Hans
用于简体中文,zh-Hant
用于繁体中文,或更具体:zh-Hans-SG
用于新加坡简体中文,zh-Hant-MO
为澳门的繁体中文.这不是一组详尽的选项,有很多.
According to RFC 5646, Chinese can have the following representation: zh-Hans
for Simplified Chinese, zh-Hant
for Traditional Chinese, or more specific: zh-Hans-SG
for Simplified Chinese for Singapore, zh-Hant-MO
for Traditional Chinese for Macau. This is not an exhaustive set of options, there are many.
我肯定知道的一件事——中文不能表示如下:zh
, or zh-CN
, or zh-TW
and之类的.
One thing I know for sure - Chinese cannot be represented as follows: zh
, or zh-CN
, or zh-TW
and the like.
但是,现实中的情况如何?如果说中文的用户访问了该网站,我可以在 Accept-Language 标题中看到什么?
However, how are things in reality? If the site is visited by a user who speaks Chinese, what can I expect in the Accept-Language header?
推荐答案
好吧,我安装了 Windows Sandbox,我可以在那里安装我想要的任何东西.
Well, I got the Windows Sandbox installed and I was able to install whatever I wanted there.
我检查了两个浏览器:
- QQ浏览器(默认选择中文,不知道是哪个脚本).
- 谷歌浏览器(添加了所有支持的中文语言和使他们成为名单上的第一名).
QQ在accept-language
头中发送如下内容:zh-CN, zh;q = 0.9
.
QQ sends in the request the following content in the accept-language
header: zh-CN, zh; q = 0.9
.
谷歌浏览器在 accept-language
标头中发送以下内容:zh-CN, zh-TW;q = 0.9,zh-HK;q = 0.8, zh;q = 0.7,恩;q = 0.6
,我还弄清楚了 Chrome 在指定代码下的含义:
Google Chrome sends the following content in the accept-language
header: zh-CN, zh-TW; q = 0.9, zh-HK; q = 0.8, zh; q = 0.7, en; q = 0.6
, also I figured out what Chrome means under the indicated codes:
zh-CN
- 中文(简体)zh-TW
- 中文(繁体)zh-HK
- 中文(香港)zh
- 中文
zh-CN
- Chinese (Simplified)zh-TW
- Chinese (Traditional)zh-HK
- Chinese (Hong Kong)zh
- Chinese
说实话,这很奇怪,但这是事实.
To be honest, this is strange, but it is a fact.
这篇关于Accept-Language 标头的典型中文语言代码是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!