Table of contents
- Document structure & metadata
- Character sets, character encodings and entities
- Specifying the language of content
- Handling elements that vary by locale
|
Document structure & metadata
-
Use the meta element in HTML documents to explicity declare the document's character
encoding.
-
The meta declaration must only be used when the character encoding is organized such that
ASCII-valued bytes stand for ASCII characters (at least until the meta element is parsed).
-
meta declarations should appear as early as possible in the head
element.
-
Use the lang and xml:lang attributes in the html tag.
Character sets, character encodings and entities
-
A document encoding SHOULD be chosen which maximizes the opportunity to directly represent characters and minimizes the need
to represent characters by markup means such as character escapes.
-
Encode web pages in UTF-8 unless there is a good reason not to.
-
Use IANA's preferred names for charset declarations.
-
Use character sets and encodings that will be accessible and common to your users.
-
Use the meta element in HTML documents to explicity declare the document's character
encoding.
-
The meta declaration must only be used when the character encoding is organized such that
ASCII-valued bytes stand for ASCII characters (at least until the meta element is parsed).
-
meta declarations should appear as early as possible in the head
element.
-
Escapes SHOULD be avoided when the characters to be expressed are representable in the character
encoding of the document.
-
Content SHOULD use the hexadecimal form of character escapes when there is one.
-
If, for a specific application, it becomes necessary to refer to characters outside [ISO10646], characters should be assigned
to a private zone to avoid conflicts with present or future versions of the standard. This is highly discouraged, however, for reasons of
portability.
-
Don't use entities in XHTML?
-
Something about the use of inline images to represent characters
- Specifying the language of content
Text direction
-
Add dir="rtl" to the html tag.
-
Enter all text in a single logical order, and leave it to the Unicode bidirectional algorithm to order the text as
appropriate
-
If using an ISO encoding, choose iso-8859-8-i. (Alternatively use utf-8 or utf-16.)
-
Use the bdo element to force the directionality of a sequence of inline characters.
-
Use the special entities, ‎ and ‏ to force directionality of directionally neutral characters.
Handling elements that vary by locale
|