당신은
감지 캐릭터 세트는 또한 HTTP Response Headers 또는 응답 데이터 자체에서 사용할 수 있습니다.
예 :
var_dump(
mb_detect_encoding(
file_get_contents('http://stackoverflow.com/questions/4407854')
),
$http_response_header
);
출력 (codepad) :
string(5) "UTF-8"
array(9) {
[0]=>
string(15) "HTTP/1.1 200 OK"
[1]=>
string(33) "Cache-Control: public, max-age=11"
[2]=>
string(38) "Content-Type: text/html; charset=utf-8"
[3]=>
string(38) "Expires: Fri, 10 Dec 2010 10:40:07 GMT"
[4]=>
string(44) "Last-Modified: Fri, 10 Dec 2010 10:39:07 GMT"
[5]=>
string(7) "Vary: *"
[6]=>
string(35) "Date: Fri, 10 Dec 2010 10:39:55 GMT"
[7]=>
string(17) "Connection: close"
[8]=>
string(21) "Content-Length: 34119"
}
우리는 공급 특정 문자 집합을 선언하지만, 또 다른 하나를 사용하는 가정해야 하는가? –
예, 그게 원인입니다. – Pentium10
예제 피드를 제공하십시오 please – Gordon