PDA

View Full Version : Unicode the standard import format?



slug
16 Jun 2010, 04:43 AM
Hi,
I am creating a Spanish version of an English web site. As you can imagine there are a lot of accented letters and special charactars in the text. Is there any alternative to inserting the HTML entity codes (&----;) for each special charactar? A techy friend told me if I saved my input text as Unicode (save as plain text file with Unicode -utf-8 - coding) before importing it in to Dreamweaver, and if the following tag was in the head of my HTML document
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
then any browser should be able to read all of the text inclduing all of the special charactars.
Anyone know if this is true or what is best practice?
I have tried it on a test page, here:
http://www.ilovetari...x-esn-test.html
Internet Explorer can read the special charactars but Firefox can't.
???

Thanks
slug X

tivy
16 Jun 2010, 02:57 PM
Yes, if you add that meta tag to the top of your page, then your characters will render properly on different browsers. If the browser doesn't have the proper code page (UTF-8), then it will prompt the user to download it in order to display the page properly.

Keep in mind that with UTF-8, the characters (or entities) are defined using a numerical code (&#xe5; or something like that). If your pointing to an XHTML doc type, then here's a list of defined codes (http://www.w3.org/TR/REC-html40/sgml/entities.html) (things like &amp;).

If you want to use a character that's not defined in the standard entities, you'll have to enter its numerical code in directly. Here's a list of the UTF-8 character set (http://www.utf8-chartable.de/). So for example, if I wanted to use an Latin Wynn character, I would type &#x1f7; into my HTML page (where 1f7 is the hexadecimal code for the character).

You can read more on W3's page (http://www.w3.org/TR/REC-html40/charset.html) (the section you're interested in is 5.3).