## Localizing HTML Data

The HTML data contained in topic files can be localized as specified in the HTML 4.0 specification (`http://w3c.org/TR/REC-html40/`). Both the character encoding and the language can be set.

### Character Encoding

Character encoding is an unambiguous mapping of the members of a character set (letters, ideographs, digits, symbols, or control functions) to specific numeric code values. Character encoding can be set for HTML files in the following ways (listed in order of precedence):

- HTTP protocol
- HTML `<META>` declaration
- HTML `charset` attribute on an external source (not recognized by the JavaHelp system)

Only one encoding can be specified for any file.

#### HTTP Protocol

If the HTML file is provided by a server via the HTTP protocol, the server can specify the character set using the `charset` parameter in the HTTP `Content-Type` field.

#### `<META>` Declaration

The HTML `<META>` declaration can be used to specify the character encoding. Encoding is specified using the `charset` parameter, as follows:

    <META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=x-euc-jp">

### Specifying a Language

The language can be set in HTML files in the following ways (listed in order of precedence):

- The `lang` attribute
- Inheritance from the closest element (tag)
- The `<META>` declaration
- The HTTP protocol `Content-Language` header
- The default locale of the helpset
- The default locale of the application

#### The HTML `lang` Attribute

The `lang` attribute specifies the language of a specific element (tag>. It can be applied to every HTML element except the following: <`APPLET>`, `<BASE>`, `<BASEFONT>`, `<BR>`, `<FRAME>`, `<FRAMESET>`, `<HR>`, `<IFRAME>`, `<PARAM>`, and `<SCRIPT>`.

The following is an example of the `lang` attribute being used with the `<P>` tag:

        <P lang="en-US">

Any elements (tags) nested within a tag automatically inherit the parent tag's language.

The syntax of the lang attribute is:

lang | = language-code
language-code | = primarycode ('-' subcode)
primarycode | = ISO639 | IonaCode | UserCode
ISO639 | = 2 alpha characters
IonaCode | = (i | I) '-' (alpha characters)
UserCode | = (x | X) '-' (alpha characters)
subcode | = (alpha characters)

For more information about the `lang` attribute, please refer to the HTML 4.0 specification at the World Wide Web Consortium web site (`http://w3c.org/TR/REC-html40/`).

#### `<META>` Declaration

The HTML `<META>` declaration can be used to specify the file's language. Language is specified using the `Content-Language` parameter:

    <META http-equiv="Content-Language" content="en-US">

#### HTTP Protocol

If the HTML file is provided by a server via the HTTP protocol, the server can specify the language for that file using the HTTP `Content-Language` header (for example, `Content-Language:en-US`).

See also:

  Localizing Help Information
  Localizing Help Presentation
  Localizing Helpsets
  Localizing XML Data
  Localization and Fonts
  Localizing the Full-Text Search Database