$ _SERVER ['HTTP_REFERER'] Request.ServerVariables vs ("HTTP_REFERER")

1 Cevap php

Sorgu dizesi olmayan ingilizce karakterleri varsa neden $ _SERVER ['HTTP_REFERER'] (PHP) ve Request.ServerVariables ("HTTP_REFERER") (ASP) farklı bir sonuç döndürebilir?

php dönüş değerinin doğru ama asp olmaz:

php: сабака

asp: ׁ | ° | ± | ° | ÷ | °

1 Cevap

Göre RFC 2616, ISO-8859-1 karakterleri özel olarak kodlanmış olmalıdır. Bu nedenle kim size başlıkları gönderiyor spec kırma gibi görünüyor. field-content ve TEXT bakınız.

4.2 Message Headers

message-header = field-name ":" [ field-value ]
field-name     = token
field-value    = *( field-content | LWS )
field-content  = <the OCTETs making up the field-value
                 and consisting of either *TEXT or combinations
                 of token, separators, and quoted-string>

2.2 Basic Rules

TEXT           = <any OCTET except CTLs,
                 but including LWS>

The TEXT rule is only used for descriptive field contents and values that are not intended to be interpreted by the message parser. Words of *TEXT MAY contain characters from character sets other than ISO- 8859-1 [22] only when encoded according to the rules of RFC 2047 [14].