当前位置: 技术问答>java相关
request.getHeader("accept-language")疑问
来源: 互联网 发布时间:2015-01-11
本文导语: 返回 accept-language=zh-cn,en;q=0.5 问 q=0.5是什么意思? | Accept-Language: zh-cn, en;q=0.5 意思是:我希望使用zh-cn ,但可以接受 en 编码方式,重要程度是 0.5 参见RFC2616 中关于服务器与客户端协商...
返回 accept-language=zh-cn,en;q=0.5
问 q=0.5是什么意思?
问 q=0.5是什么意思?
|
Accept-Language: zh-cn, en;q=0.5
意思是:我希望使用zh-cn ,但可以接受 en 编码方式,重要程度是 0.5
参见RFC2616 中关于服务器与客户端协商参数中关于qvalue 的说明,我贴出原文如下(翻译水平不高,恐怕你更希望看原文吧):
3.9 Quality Values
HTTP content negotiation (section 12) uses short "floating point"
numbers to indicate the relative importance ("weight") of various
negotiable parameters. A weight is normalized to a real number in
the range 0 through 1, where 0 is the minimum and 1 the maximum
value. If a parameter has a quality value of 0, then content with
this parameter is `not acceptable' for the client. HTTP/1.1
applications MUST NOT generate more than three digits after the
decimal point. User configuration of these values SHOULD also be
limited in this fashion.
qvalue = ( "0" [ "." 0*3DIGIT ] )
| ( "1" [ "." 0*3("0") ] )
"Quality values" is a misnomer, since these values merely represent
relative degradation in desired quality.
意思是:我希望使用zh-cn ,但可以接受 en 编码方式,重要程度是 0.5
参见RFC2616 中关于服务器与客户端协商参数中关于qvalue 的说明,我贴出原文如下(翻译水平不高,恐怕你更希望看原文吧):
3.9 Quality Values
HTTP content negotiation (section 12) uses short "floating point"
numbers to indicate the relative importance ("weight") of various
negotiable parameters. A weight is normalized to a real number in
the range 0 through 1, where 0 is the minimum and 1 the maximum
value. If a parameter has a quality value of 0, then content with
this parameter is `not acceptable' for the client. HTTP/1.1
applications MUST NOT generate more than three digits after the
decimal point. User configuration of these values SHOULD also be
limited in this fashion.
qvalue = ( "0" [ "." 0*3DIGIT ] )
| ( "1" [ "." 0*3("0") ] )
"Quality values" is a misnomer, since these values merely represent
relative degradation in desired quality.