Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force UTF-8 encoding in browser?

I have page which 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 browser. I have tried to set encoding by 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 BOM. The only solution which I tried and it had worked was setting encoding in .htaccess file by adding AddDefaultCharset UTF-8 line, but then another pages on the server were not displayed correctly. How can I solve this problem?

like image 326
mkas Avatar asked Oct 18 '11 15:10

mkas


1 Answers

Disable default charset:

AddDefaultCharset Off
like image 92
Gerben Avatar answered Sep 28 '22 08:09

Gerben