When I create the non-English pages (for example, Russian) I have to use header() to set page's charset (I use UTF-8):
header('Content-Type: text/html; charset=utf-8');
But all my pages should have UTF-8 charset, is there a propery in php to set it by default (I mean: I don't want to set it every time).
You can use the .htaccess file to do it:
AddDefaultCharset UTF-8
If you want something a bit more robust, you can specify this charset type for only specific file types:
<FilesMatch ".(htm|html|css|js)$">
AddDefaultCharset UTF-8
</FilesMatch>
Also see this article for other ways of doing it: http://www.askapache.com/htaccess/setting-charset-in-htaccess.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With