The character encoding tells the browser what character set the web page is written in. If you don't specify a character set, the browser will assume that the web page uses a default one. If it guesses wrong, your page may be displayed incorrectly. To avoid this, use one of the below methods to specify the character set your pages are encoded in.
Set the Character Set from the Server
This is the most efficient method to set the character set, because you don't need to set it for every page. Set your server to send a
Content-Typeheader for all documents it serves that are of type text/html. For example:
Content-Type: text/html; charset=UTF-8
Use a Meta Tag on Every Page
If you don't control the server, you will need to set the character encoding manually for every page. You can do this with a meta tag:
<meta http-equiv="content-type" content="text/html;charset=utf-8">
You can use the meta tag method to change the character encoding from the server defined one, but this can sometimes cause conflicts.