The first thing to know is what character-set encoding to use. When I started in eBooks about 10 years ago it was often a pain to get special characters, but about that time an encoding called “UTF-8” became common. This extended character set will enable you to retain the special characters from your word processing file and to add special characters with a simple code. The following is a code sample for the head of the XHTML in your eBook.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
</head>
Notice that in the code sample we use the inch-mark instead of typographer’s quote.
Next, you need the right characters in your eBook. If you use the utf-8 charaset, the quotation marks, em-dashes, apostrophes, and other special characters you used in your text file should render correctly. If you find that they are not, you need to use the actual entity from the XHTML entity list. For most characters, there is a pseudo-English name for the entity. For all characters, there is a numeric code that you can use to get the right character. Below is a chart of the most common entities in novel publishing.
Entity | Entity Displayed | Number | Number Displayed | Description |
& | & | & | & | ampersand |
“ | “ | “ | “ | left double quotation mark |
‘ | ‘ | ‘ | ‘ | left single quotation mark |
” | ” | ” | ” | right double quotation mark |
’ | ’ | ’ | ’ | right single quotation mark |
  |   | em space | ||
  |   | en space | ||
|   | no-break space = non-breaking space | ||
— | — | — | — | em dash |
– | – | – | – | en dash |
© | © | © | © | copyright sign |
… | … | … | … | horizontal ellipsis = three dot leader |
If you'd like a more complete explanation of entities and how to use them, Elizabeth Castro’s Character Entity References in HTML 4 and XHTML 1.0 site is the best available.
No comments:
Post a Comment