Global UTF-encoding, the right way
- by mowgli
I'm curious, as to what is the right way to have UTF-8 encoding on all web files
All my files (incl. CSS and JS) are made and saved in UTF-8 encoding
In PHP, I set the char-set on top of the main page (this page includes all others) with:
header('Content-type: text/html; charset=utf-8');
In the same page I have this html meta tag:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Then I stubled upon an external css file that has this on first line:
@charset "UTF-8";
And now I wonder, should I set the charset INSIDE all my CSS/JS files too, like that?
And/or should I serve each file with charset=utf-8 in the meta tag?