What exactly is a charset? I have googled it but i still don't understand how important it is. Which is the best one to use A or B ? A: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> or B: <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> thanks in advance
It's often a personal preference, unless you are also using XML in which case I think it MUST be utf-8. Both are charsets for Western Latin letters, though UTF-8 I know also does Cyrillic and Greek. More important is that what's in that meta tag matches up with what's on the hosting server AND how the document is saved (usually when you save a text document in something like Notepad, it asks you what charset you want). I like utf-8. There were some problems with UNIX systems long ago, which I think has been fixed, because there's a bit in front of utf-8 documents and it conflicted with the beginning of some shell scripts or something... or I'm talking out my butt... I forget. If you only use Western characters, like in English, pick one eeny-meeny miny mo and stick with it.
I'll let Tommy Olsson explain it for you. http://www.sitepoint.com/article/guide-web-character-encoding
This is what I meant with Unix systems. The BOM looked like the beginning of a shell script I think. Like #!/bin/bash-- the #! says "this is a script". However, I haven't had a problem so many this has been fixed. Another thing to keep in mind (if you want) is to try avoid using the & copy ; -style character entities if you are calling your page XHTML. Does it matter? No. But if I'm going to waste my time closing <img /> tags etc I might as well use & # number ; entities since XML only allows 5 (one of which isn't allowed in HTML, the &apos) which leaves you with 4. 99.99999% of XHTML web pages will never ever ever be converted into an XML page or parsed by an XML parser but what the hell? So I limit my entities while using utf-8.
Say if a site was going to have various european translations (just an example) would the charset choice make a difference? Thanks for the info here by the way.
I need to read a bit further then, i haven't visited your suggested link yet Dan, will do later today, thanks.