<s>
While	O
Hypertext	B-Language
Markup	I-Language
Language	I-Language
(	O
HTML	B-Language
)	O
has	O
been	O
in	O
use	O
since	O
1991	O
,	O
HTML	B-Language
4.0	I-Language
from	O
December	O
1997	O
was	O
the	O
first	O
standardized	O
version	O
where	O
international	O
characters	O
were	O
given	O
reasonably	O
complete	O
treatment	O
.	O
</s>
<s>
When	O
an	O
HTML	B-Language
document	O
includes	O
special	O
characters	O
outside	O
the	O
range	O
of	O
seven-bit	B-Protocol
ASCII	I-Protocol
,	O
two	O
goals	O
are	O
worth	O
considering	O
:	O
the	O
information	O
's	O
integrity	O
,	O
and	O
universal	O
browser	B-Application
display	O
.	O
</s>
<s>
First	O
,	O
the	O
web	B-Application
server	I-Application
can	O
include	O
the	O
character	O
encoding	O
or	O
"	O
charset	O
"	O
in	O
the	O
Hypertext	B-Protocol
Transfer	I-Protocol
Protocol	I-Protocol
(	O
HTTP	B-Protocol
)	O
Content-Type	O
header	O
,	O
which	O
would	O
typically	O
look	O
like	O
this	O
:	O
</s>
<s>
This	O
method	O
gives	O
the	O
HTTP	B-Application
server	I-Application
a	O
convenient	O
way	O
to	O
alter	O
document	O
's	O
encoding	O
according	O
to	O
content	B-Protocol
negotiation	I-Protocol
;	O
certain	O
HTTP	B-Application
server	I-Application
software	O
can	O
do	O
it	O
,	O
for	O
example	O
Apache	O
with	O
the	O
module	B-Application
mod_charset_lite	O
.	O
</s>
<s>
For	O
HTML	B-Language
it	O
is	O
possible	O
to	O
include	O
this	O
information	O
inside	O
the	O
head	O
element	O
near	O
the	O
top	O
of	O
the	O
document	O
:	O
</s>
<s>
HTML5	B-Application
also	O
allows	O
the	O
following	O
syntax	O
to	O
mean	O
exactly	O
the	O
same	O
:	O
</s>
<s>
XHTML	B-Language
documents	O
have	O
a	O
third	O
option	O
:	O
to	O
express	O
the	O
character	O
encoding	O
via	O
XML	B-Protocol
declaration	O
,	O
as	O
follows	O
:	O
</s>
<s>
If	O
the	O
character	O
encoding	O
is	O
an	O
ASCII	B-Protocol
extension	I-Protocol
then	O
the	O
content	O
up	O
to	O
and	O
including	O
the	O
declaration	O
itself	O
should	O
be	O
pure	O
ASCII	B-Protocol
and	O
this	O
will	O
work	O
correctly	O
.	O
</s>
<s>
For	O
character	O
encodings	O
that	O
are	O
not	O
ASCII	B-Protocol
extensions	I-Protocol
(	O
i.e.	O
</s>
<s>
not	O
a	O
superset	O
of	O
ASCII	B-Protocol
)	O
,	O
such	O
as	O
UTF-16BE	O
and	O
UTF-16LE	O
,	O
a	O
processor	O
of	O
HTML	B-Language
,	O
such	O
as	O
a	O
web	B-Application
browser	I-Application
,	O
should	O
be	O
able	O
to	O
parse	O
the	O
declaration	O
in	O
some	O
cases	O
through	O
the	O
use	O
of	O
heuristics	O
.	O
</s>
<s>
As	O
of	O
HTML5	B-Application
the	O
recommended	O
charset	O
is	O
UTF-8	O
.	O
</s>
<s>
Characters	O
outside	O
of	O
the	O
printable	O
ASCII	B-Protocol
range	O
(	O
32	O
to	O
126	O
)	O
usually	O
appear	O
incorrectly	O
.	O
</s>
<s>
Finally	O
,	O
browsers	B-Application
usually	O
permit	O
the	O
user	O
to	O
override	O
incorrect	O
charset	O
label	O
manually	O
as	O
well	O
.	O
</s>
<s>
UTF-16	O
or	O
UTF-32	O
,	O
which	O
can	O
be	O
used	O
for	O
all	O
languages	O
as	O
well	O
,	O
are	O
less	O
widely	O
used	O
because	O
they	O
can	O
be	O
harder	O
to	O
handle	O
in	O
programming	O
languages	O
that	O
assume	O
a	O
byte-oriented	O
ASCII	B-Protocol
superset	O
encoding	O
,	O
and	O
they	O
are	O
less	O
efficient	O
for	O
text	O
with	O
a	O
high	O
frequency	O
of	O
ASCII	B-Protocol
characters	I-Protocol
,	O
which	O
is	O
usually	O
the	O
case	O
for	O
HTML	B-Language
documents	O
.	O
</s>
<s>
The	O
WHATWG	B-Language
Encoding	O
Standard	O
,	O
referenced	O
by	O
recent	O
HTML	B-Language
standards	O
(	O
the	O
current	O
WHATWG	B-Language
HTML	B-Language
Living	O
Standard	O
,	O
as	O
well	O
as	O
the	O
formerly	O
competing	O
W3C	O
HTML	B-Application
5.0	I-Application
and	O
5.1	O
)	O
specifies	O
a	O
list	O
of	O
encodings	O
which	O
browsers	B-Application
must	O
support	O
.	O
</s>
<s>
The	O
HTML	B-Language
standards	O
forbid	O
support	O
of	O
other	O
encodings	O
.	O
</s>
<s>
Besides	O
UTF-8	O
,	O
the	O
following	O
encodings	O
are	O
explicitly	O
listed	O
in	O
the	O
HTML	B-Language
standard	O
itself	O
,	O
with	O
reference	O
to	O
the	O
Encoding	O
Standard	O
:	O
</s>
<s>
Although	O
the	O
same	O
security	O
concern	O
applies	O
to	O
ISO-2022-JP	O
and	O
UTF-16	O
,	O
which	O
also	O
allow	O
sequences	O
of	O
ASCII	B-Protocol
bytes	O
to	O
be	O
interpreted	O
differently	O
,	O
this	O
approach	O
was	O
not	O
seen	O
as	O
feasible	O
for	O
them	O
since	O
they	O
are	O
comparatively	O
more	O
frequently	O
used	O
in	O
deployed	O
content	O
.	O
</s>
<s>
In	O
addition	O
to	O
native	O
character	O
encodings	O
,	O
characters	O
can	O
also	O
be	O
encoded	O
as	O
character	O
references	O
,	O
which	O
can	O
be	O
numeric	O
character	O
references	O
(	O
decimal	B-Application
or	O
hexadecimal	O
)	O
or	O
character	B-General_Concept
entity	I-General_Concept
references	I-General_Concept
.	O
</s>
<s>
Character	B-General_Concept
entity	I-General_Concept
references	I-General_Concept
are	O
also	O
sometimes	O
referred	O
to	O
as	O
named	O
entities	O
,	O
or	O
HTML	B-General_Concept
entities	I-General_Concept
for	O
HTML	B-Language
.	O
</s>
<s>
HTML	B-Language
's	O
usage	O
of	O
character	O
references	O
derives	O
from	O
SGML	B-Language
.	O
</s>
<s>
where	O
nnnn	O
is	O
the	O
code	O
point	O
in	O
decimal	B-Application
form	O
,	O
and	O
hhhh	O
is	O
the	O
code	O
point	O
in	O
hexadecimal	O
form	O
.	O
</s>
<s>
The	O
x	O
must	O
be	O
lowercase	O
in	O
XML	B-Protocol
documents	I-Protocol
.	O
</s>
<s>
Not	O
all	O
web	B-Application
browsers	I-Application
or	O
email	B-Protocol
clients	I-Protocol
used	O
by	O
receivers	O
of	O
HTML	B-Language
documents	O
,	O
or	O
text	B-Application
editors	I-Application
used	O
by	O
authors	O
of	O
HTML	B-Language
documents	O
,	O
will	O
be	O
able	O
to	O
render	O
all	O
HTML	B-General_Concept
characters	I-General_Concept
.	O
</s>
<s>
For	O
codes	O
from	O
0	O
to	O
127	O
,	O
the	O
original	O
7-bit	B-Protocol
ASCII	I-Protocol
standard	O
set	O
,	O
most	O
of	O
these	O
characters	O
can	O
be	O
used	O
without	O
a	O
character	O
reference	O
.	O
</s>
<s>
Codes	O
from	O
160	O
to	O
255	O
can	O
all	O
be	O
created	O
using	O
character	B-General_Concept
entity	I-General_Concept
names	I-General_Concept
.	O
</s>
<s>
Only	O
a	O
few	O
higher-numbered	O
codes	O
can	O
be	O
created	O
using	O
entity	O
names	O
,	O
but	O
all	O
can	O
be	O
created	O
by	O
decimal	B-Application
number	O
character	O
reference	O
.	O
</s>
<s>
Character	B-General_Concept
entity	I-General_Concept
references	I-General_Concept
can	O
also	O
have	O
the	O
format	O
&	O
name	O
;	O
where	O
name	O
is	O
a	O
case-sensitive	O
alphanumeric	O
string	O
.	O
</s>
<s>
For	O
example	O
,	O
"	O
λ	O
"	O
can	O
also	O
be	O
encoded	O
as	O
λ	O
in	O
an	O
HTML	B-Language
document	O
.	O
</s>
<s>
The	O
character	B-General_Concept
entity	I-General_Concept
references	I-General_Concept
<	O
,	O
>	O
,	O
"	O
and	O
&	O
are	O
predefined	O
in	O
HTML	B-Language
and	O
SGML	B-Language
,	O
because	O
<, >	O
,	O
"	O
and	O
&	O
are	O
already	O
used	O
to	O
delimit	O
markup	O
.	O
</s>
<s>
This	O
notably	O
did	O
not	O
include	O
XML	B-Protocol
's	O
'	O
( 	O
 '	O
)	O
entity	O
prior	O
to	O
HTML5	B-Application
.	O
</s>
<s>
For	O
a	O
list	O
of	O
all	O
named	O
HTML	B-General_Concept
character	I-General_Concept
entity	I-General_Concept
references	I-General_Concept
along	O
with	O
the	O
versions	O
in	O
which	O
they	O
were	O
introduced	O
,	O
see	O
List	B-General_Concept
of	I-General_Concept
XML	I-General_Concept
and	I-General_Concept
HTML	I-General_Concept
character	I-General_Concept
entity	I-General_Concept
references	I-General_Concept
.	O
</s>
<s>
Unnecessary	O
use	O
of	O
HTML	B-Language
character	O
references	O
may	O
significantly	O
reduce	O
HTML	B-Language
readability	O
.	O
</s>
<s>
If	O
the	O
character	O
encoding	O
for	O
a	O
web	O
page	O
is	O
chosen	O
appropriately	O
,	O
then	O
HTML	B-Language
character	O
references	O
are	O
usually	O
only	O
required	O
for	O
markup	O
delimiting	O
characters	O
as	O
mentioned	O
above	O
,	O
and	O
for	O
a	O
few	O
special	O
characters	O
(	O
or	O
none	O
at	O
all	O
if	O
a	O
native	O
Unicode	O
encoding	O
like	O
UTF-8	O
is	O
used	O
)	O
.	O
</s>
<s>
Incorrect	O
HTML	B-General_Concept
entity	I-General_Concept
escaping	O
may	O
also	O
open	O
up	O
security	O
vulnerabilities	O
for	O
injection	O
attacks	O
such	O
as	O
cross-site	O
scripting	O
.	O
</s>
<s>
If	O
HTML	B-Language
attributes	O
are	O
left	O
unquoted	O
,	O
certain	O
characters	O
,	O
most	O
importantly	O
whitespace	O
,	O
such	O
as	O
space	O
and	O
tab	O
,	O
must	O
be	O
escaped	O
using	O
entities	O
.	O
</s>
<s>
Other	O
languages	O
related	O
to	O
HTML	B-Language
have	O
their	O
own	O
methods	O
of	O
escaping	O
characters	O
.	O
</s>
<s>
Unlike	O
traditional	O
HTML	B-Language
with	O
its	O
large	O
range	O
of	O
character	B-General_Concept
entity	I-General_Concept
references	I-General_Concept
,	O
in	O
XML	B-Protocol
there	O
are	O
only	O
five	O
predefined	O
character	B-General_Concept
entity	I-General_Concept
references	I-General_Concept
.	O
</s>
<s>
All	O
other	O
character	B-General_Concept
entity	I-General_Concept
references	I-General_Concept
have	O
to	O
be	O
defined	O
before	O
they	O
can	O
be	O
used	O
.	O
</s>
<s>
For	O
example	O
,	O
use	O
of	O
é	O
(	O
which	O
gives	O
é	O
,	O
Latin	O
lower-case	O
E	O
with	O
acute	O
accent	O
,	O
U+00E9	O
in	O
Unicode	O
)	O
in	O
an	O
XML	B-Protocol
document	I-Protocol
will	O
generate	O
an	O
error	O
unless	O
the	O
entity	O
has	O
already	O
been	O
defined	O
.	O
</s>
<s>
XML	B-Protocol
also	O
requires	O
that	O
the	O
x	O
in	O
hexadecimal	O
numeric	O
references	O
be	O
in	O
lowercase	O
:	O
for	O
example	O
ਛ	O
rather	O
than	O
ਛ	O
.	O
</s>
<s>
XHTML	B-Language
,	O
which	O
is	O
an	O
XML	B-Protocol
application	O
,	O
supports	O
the	O
HTML	B-General_Concept
entity	I-General_Concept
set	O
,	O
along	O
with	O
XML	B-Protocol
's	O
predefined	O
entities	O
.	O
</s>
