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" />
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.
(Graph current as of Feb. 2012, see comment below for more exact values.)
UTF-8 is supported everywhere on the web. Only in specific applications is it not. You should always use utf-8 if you can.
The downside is that for languages such as chinese, utf-8 takes more space than, say, utf-16. But if you don't plan on going chinese, or even if you do go chinese then utf-8 is fine.
The only cons against using utf-8 is that it takes more space compared to various encodings, but compared to western languages it takes almost no extra space at all, except for very special characters, and those extra bytes you can live with. We are in 2009 after all. ;)
If you want world domination, use UTF-8
all the way, because this covers every human character available at the world, including Asian, Cyrillic, Hebrew, Arabic, Greek and so on, while ISO-8859
is only restricted to Latin characters. You don't want to have Mojibake.
I find iso-8859-1 very useful on a couple of sites where I have clients sending me text files that were created in Word or Publisher, that I can easily insert into the midst of PHP code and not worry about it - especially where quotes are concerned. These are local, U.S. companies, there is literally no other difference in the text on the pages, and I see no disadvantage in using that character set on those particular pages. All others are UTF-8.