Saving Your Page with the Proper Encoding


At the beginning of this book, I said you had to save your Web pages as "text-only" documents, and made little mention of the encoding (see page 46). That's because most of my readers create Web pages and style sheets in the same language as their operating system and because most text editors automatically save files with the default system encoding. You only need to manually choose the encoding as you save if your document contains characters that don't belong to your system's default character encoding.

To save your page with the proper encoding:

1.

When you go to save your document, choose the option for selecting an encoding.

In BBEdit, it's a button called Options.

In Word, it's called Encoded Text, and you'll find it in the Save as type box.

2.

Choose the desired encoding from the list or options that appear (Figure 21.11).

3.

Finish saving the document.

Figure 21.10. In BBEdit, a popular (X)HTML editor for Mac, click the Options button when you go to save your file.


Figure 21.11. Choose the desired encoding from the Encoding pop-up menu. I recommend choosing UTF-8, no BOM (Byte-Order Mark). You should only use an option with BOM if you're using UTF-16 (which needs it). Otherwise, it causes problems with some browsers.


Tips

  • Which is the proper encoding? My first choice would be UTF-8. My second choice would be the regional encoding for the main language used on your page. For a list of regional encodings, see http://www.w3.org/International/O-charset-lang.html.

  • When you declare the encoding (see page 330), BBEdit, from version 7 on, automatically saves your file with that same encoding. I love that.





HTML, XHTML, & CSS(c) Visual QuickStart Guide
HTML, XHTML, and CSS, Sixth Edition
ISBN: 0321430840
EAN: 2147483647
Year: 2004
Pages: 340

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net