ISO-8859-1 vs UTF-8?

Jitendra Vyas picture Jitendra Vyas · Dec 12, 2009 · Viewed 54k times · Source

What should be used and when ? or is it always better to use UTF-8 always? or ISO-8859-1 still has importance in specific conditions?

Is Character-set related to geographic region?


Edit:

Is there any benefit to put this code @charset "utf-8";

or like this <link type="text/css; charset=utf-8" rel="stylesheet" href=".." />

at the top of CSS file?

I found for this

If DreamWeaver adds the tag when you add embedded style to the document, that is a bug in DreamWeaver. From the W3C FAQ:

"For style declarations embedded in a document, @charset rules are not needed and must not be used."

The charset specification is a part of CSS since version 2.0 (may 1998), so if you have a charset specification in a CSS file and Safari can't handle it, that's a bug in Safari.

and add accept-charset in form

<form action="/action" method="post" accept-charset="utf-8">

and what should be use if i use xhtml doctype

<?xml version="1.0" encoding="UTF-8"?>

or

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

Answer

nes1983 picture nes1983 · Dec 12, 2009

Unicode is taking over and has already surpassed all others. I suggest you hop on the train right now.

Note that there are several flavors of unicode. Joel Spolsky gives an overview.

Unicode is winning (Graph current as of Feb. 2012, see comment below for more exact values.)