Forum Moderators: open

Message Too Old, No Replies

UTF-8 and iso-8859-1

         

Gabby7

3:38 pm on Jul 14, 2010 (gmt 0)

10+ Year Member



Hello+
I'm new to web programming and have become a bit confused. I have the following on my web page...


<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>


My question is: Can I simply replace the iso-8859-1 in the meta tag with the UTF-8? If so, what would that look like? If not, why not? (It is my understanding that the UTF-8 is the more recent coding and should be used.) Or are these 2 different things entirely?

Any guidance would be greatly appreciated. Thanx!

commanderW

11:48 pm on Jul 14, 2010 (gmt 0)

10+ Year Member



Hi Gabby7 - ISO-8859-1, often called Latin-1, is an older character encoding that is limited mainly to European alphabets.UTF-8 is the newer Unicode character set which includes all the major alphabets in the world ( and many minor ones :) Latin-1 is actually contained within Unicode.

You need Unicode if you want to present text in languages like Chinese, Japanese, Thai, Hindi, or Ogham [alanwood.net ].

If your web pages are all in a common european language then you don't need to worry about it. But if you want to be cosmopolitan and do things like write the name of Cantopop diva Faye Wong in chinese characters, then baby you'd better have UTF-8 in your charset declaration.

You can do this just by substituting UTF-8 where you have ISO-8859-1.

- Note that you must not only declare UTF-8 in your html header, but the actual text file for that html page must be saved as UTF-8. This is done by going into preferences for your text editor and choosing that. A hitch is that you can have trouble opening files in the old Latin-1 (Apple has used Mac OS Roman) after you choose to save and open as UTF-8. You have to choose that files are opened in default but saved as UTF-8. It gets a bit complicated at times, but you just have to read a little documentation when you run across a problem. There is alot of it out there all over the internet.

Research terms like ASCII, ISO-8859-1, Latin-1, UTF-8, and Unicode. Wikipedia has great overviews on all of them.

Gabby7

1:09 am on Jul 15, 2010 (gmt 0)

10+ Year Member



Thank you, commanderW! I will research what you suggest and look at my preferences in my text editor. Glad to know I can change the charset!

Thank you!

dreamcatcher

7:46 am on Jul 15, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Faye Wong in chinese characters

Great seeing Faye mentioned here. ;)

dc

commanderW

1:05 am on Jul 16, 2010 (gmt 0)

10+ Year Member



Dreamcatcher - Glad to see another Faye Wong fan here. I've been following her career since the early 90's (I've even got some Faye Wong memorabilia from chinatown!), and I still adore her.

I hope nobody misses my link to the Ogham page at the Alan Wood Unicode website [alanwood.net ]

tedster

1:26 am on Jul 16, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I haven't installed an Ogham font yet, so I can't see the glyphs. But they're available in image form on this page: [ancientscripts.com...]

commanderW

6:35 am on Jul 16, 2010 (gmt 0)

10+ Year Member



I haven't installed an Ogham font yet, so I can't see the glyphs.


Tedster - The fonts on that web page are supposed to be unicode fonts. They should be installed on your OS. I could see these fonts even on my old iBook 5 years ago. Now I'm curious about this.

dreamcatcher

10:10 pm on Jul 17, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Glad to see another Faye Wong fan here. I've been following her career since the early 90's (I've even got some Faye Wong memorabilia from chinatown!), and I still adore her.


I saw her 4 times on her last tour in Hong Kong. I`ve heard rumours her comeback starts this year in Oct with a tour in Beijing. She`s absolutely the best. :)

dc