Lesson 7

Entities

Introduction
One of the strengths of HTML is that it can composed and edited in a straightforward text editor. This is also a weakness. What happens, you may ask, if you want to display any of the special characters needed for HTML tags. Characters like '<' and '>'. Well, there is a simple but long-winded way to do so. This method can also be used to display characters not normally accessible. You can also use this method to display email addresses in a way that fools the programs that trawl the Internet gathering addresses for spammers.

The method is to enclose the data for the these special characters within an ampersand and a semi-colon. E.G. &lt; and &gt;. Now that the ampersand is used for special characters, it becomes a special character itself and is represented by &amp;. Alternatively characters can be coded as an ampersand followed by a hash sign, a number and a semi-colon. In the tables below, only the numbers are given.

Another entity which should be mentioned is the pound sign, £, which is written as '&pound;'.

Some special characters
Here are some special characters which are not really available in any other way!

charnamehexdec
©copyxa9169
®regxae174
°degxb0176


Using special characters as a code for email addresses
Spammers use programs that scan web pages on the Internet for email addresses. They look for alpha-numeric characters and for the 'at' character, i.e. '@'. Coding these characters makes these programs miss the addresses. I used to use the codes shown in the table below, alternating the decimal and hexadecimal versions, in case spammers catch on to this trick.

I understand that entities are no longer safe for displaying email addresses and so in future email addresses on this site are displayed in the form of graphics.

charhexdec
  x20 32
! x21 33
" x22 34
# x2335
$ x2436
% x2537
& x2638
' x2739
( x2840
) x2941
* x2a42
+ x2b43
, x2c44
- x2d45
. x2e46
/ x2f47
charhexdec
0x3048
1x3149
2x3250
3x3351
4x3452
5x3553
6x3654
7x3755
8x3856
9x3957
:x3a58
;x3b59
<x3c60
=x3d61
>x3e62
?x3f63
charhexdec
@x4064
Ax4165
Bx4266
Cx4367
Dx4468
Ex4569
Fx4670
Gx4771
Hx4872
Ix4973
Jx4a74
Kx4b75
Lx4c76
Mx4d77
Nx4e78
Ox4f79
charhexdec
Px6080
Qx6181
Rx6282
Sx6383
Tx6484
Ux6585
Vx6686
Wx6787
Xx6888
Yx6989
Zx6a90
[x6b91
\x6c92
]x6d93
^x6e94
-x6f95
charhexdec
'x6096
ax6197
bx6298
cx6399
dx64100
ex65101
fx66102
gx67103
hx68104
ix69105
jx6a106
kx6b107
lx6c108
mx6d109
nx6e110
ox6f111
charhexdec
px70112
qx71113
rx72114
sx73115
tx74116
ux75117
vx76118
wx77119
xx78120
yx79121
zx7a122
{x7b123
|x7c124
}x7d125
~x7e126
 x7f127


Now decode the following:
&x57;&101;&x6c;&108;&x20;&68;&x6f;&110;&65;

Previous Lesson  Previous Lesson Next Lesson  Next Lesson