Declare character encoding in HTML

5 07 2010

Writing documents in english, german and norwegian leaves you with a mess of different character encodings in documents and also webpages.

Just wrote a plain HTML page with norwegian special characters and Firefox, did not show the characters correctly, so I had to find out how to specify that the encoding of the norwegian æøå’s is UTF-8.

Fortunately there is a good explanation on the W3C Blog.

The code to specify the encoding is

http-equiv="Content-Type" content="text/html; charset=UTF-8"

I have no illusion about some browser (IE?) getting it wrong anyway. At least Firefox seems to comply…