Mastering HTML Special Characters and Entity Codes
Symbols: Why Do You Use Codes?
There are several operating systems in the world of computers. These systems are nothing but special programs that run immediately after turning on the computer and are in charge of giving "life" to the machine.
Along with these programs, computers load special tables into memory that match the characters present on a keyboard and a few others that are not, but can be entered online by other means. These tables, unfortunately, are not always the same and vary from one system to another, from one brand of computer to another, and of course, from one language to another. For example, accented letters from a PC are not like those from a Macintosh or a UNIX terminal when typing directly from the keyboard.
Universal Language and Character Tables
Since HTML is intended to be a universal language, a page should be seen as its creator intended, regardless of whether you are at a computer that "speaks" in English or Spanish, or has a specific operating system. A "conflicting" character table has been created (actually, they all are, but generally only used for special characters) where characters are written with a code instead of pressing the key directly.
Encoding the 'Ñ' and Other Characters
For example, our world-renowned "Ñ" is written as:
Code:
Ñ or Ñ
This must be done with all characters other than letters of the alphabet, numbers, and a few signs, such as the period, comma, hyphen, and some others. Therefore, we have to encode all accented letters, ñs, cedillas, etc. Below is a table with all characters; there are letters, but they will be useful only if you need to write unusual text.
Understanding the Character Table Structure
As you can see, the table has a column with the desired character followed by its code number, a description of the character, and then a short name (a sort of alias) for the more common ones, which is easier to memorize and helps with short tasks. Not everyone has a short name; for those, you have to write the code number.
Compatibility and Best Practices
Generally, you can write directly from the keyboard all characters with no alias in the table. Those that do have an alias will usually have problems in different systems if they were written directly. If you are sure that what is written in HTML will only be used as local files on machines similar to yours, there is no need to complicate life. However, if your pages will reside on a WWW server, any machine can access them, and their appearance will not be appropriate for some.
Tools for HTML Character Conversion
There are many special editors for writing HTML, and most of them have tools to automatically convert special characters to the corresponding code. There are also packages of "macros" to do the same with word processors such as Word or WordPerfect.
Character Table: Within this document are the codes to put all kinds of characters in HTML.