ISO-8859-1 vs UTF-8?

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

Is the character set associated with a geographical area?




Edit:

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

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

at the top of the CSS file?

I found for this

If DreamWeaver adds a tag when you add an inline style to a document, this is a bug in DreamWeaver. From the W3C Frequently Asked Questions:

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

The encoding specification is part of CSS since version 2.0 (May 1998), so if you have an encoding specification in a CSS file and Safari cannot handle it, that error is in Safari.

and add accept-charset in the form

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

and what should i 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" /> 
+47
css xhtml unicode utf
Dec 12 '09 at 16:43
source share
5 answers

Unicode captures and has surpassed everyone else. I suggest you jump on the train right now.

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

Unicode is winning (Graph current February 2012 , see Comment below for more accurate values.)

+55
Dec 12 '09 at 16:50
source share
— -

UTF-8 is supported everywhere on the Internet. Only in specific applications is this not the case. You should always use utf-8 if you can.

The downside is that for languages ​​like Chinese, utf-8 takes up more space than, say, utf-16. But if you do not plan to go in Chinese, or even if you go in Chinese, then utf-8 is fine.

The only drawbacks against using utf-8 is that it takes up more space compared to various encodings, but compared to Western languages ​​it almost does not require additional space, except for special characters and extra bytes that you can live with. We are in 2009 .;)

+7
Dec 12 '09 at 16:47
source share

If you want world domination , use UTF-8 completely, because it covers every person available in the world, including Asian, Cyrillic, Hebrew, Arabic, Greek, etc., and ISO-8859 limited to Latin characters only. You do not want Mojibake .

+3
Dec 12 '09 at 16:47
source share

I find iso-8859-1 very useful on several sites where I have clients sending me text files created in Word or Publisher that I can easily embed in the middle of PHP code and not worry about it - especially where it comes It's about quotes. These are local, American companies, there is literally no other difference in the text on the pages, and I see no shortage of using this character set on these specific pages. All the rest are UTF-8.

0
05 Oct '16 at 21:35
source share
  • ISO-8859-1 is a great encoding for use when the space is premium and you just want to encode characters from the base Latin languages ​​that it supports. And you will never have to ever plan to ever improve your application for supporting non-Latin languages.

  • utf8 is a fantastic way: (a) use a large 8-bit code base on character code libraries that already exist, or (b) be a euro snob. utf8 encodes the standard ascii at 1 byte per character, Latin 1 at 2 bytes per character, East European and Asian languages ​​get 3 bytes per character. It can reach 4 bytes per character if you start trying to encode ancient languages ​​that do not exist in the basic multilingual plane.

  • utf16 is a great way to start a new codebase from scratch. Its completely neutral culture - everone gets fair hands of 2 bytes per character. Ancient / exotic languages ​​require 4 bytes per character, which means - in the worst case - its bad, like its older brother:

  • utf32 is a waste of space.

-one
Dec 12 '09 at 17:12
source share



All Articles