I have a page whose encoding is declared with
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
But when I enter the page, another encoding (ISO) is chosen in the browser. I have tried to set the encoding by a PHP method
header('Content-type: text/html; charset=utf-8');
But it also didn't help. All source files are encoded in UTF-8 without a BOM. The only solution, which I tried, and it had worked, was setting the encoding in the .htaccess file by adding the AddDefaultCharset UTF-8 line, but then other pages on the server were not displayed correctly. How can I solve this problem?
file:///. The charset as specified incharsetattribute of the HTTP responseContent-Typeheader is been used when the page is served over HTTP. Perhaps you're setting the header too late in PHP (it has to be set before you write any bit to the response, you would however have been notified of this mistake if you have set the proper PHP error reporting level).AddDefaultCharset UTF-8in.htaccess.<meta>is used to determine the character encoding of a page, even if the page is served over HTTP. However, the Content-Type header takes precedence over the<meta>tag, if it is present. See w3.org/TR/html401/charset.html#h-5.2.2