![]() |
Gateway
Customization Guide Netscape Directory Server |
| Previous |
Contents |
Index |
DocHome | Next |
This chapter describes gateway localization and identifies the tasks required to set up additional gateway locales. The chapter contains the following sections:
Unicode is a character set containing all the characters of all the world's major languages. There are different standard methods to encode Unicode, including UCS-2, which is NT's Unicode version, and UTF-8, the version of Unicode specified by version 3 of the LDAP protocol.
Netscape products use UTF-8 in versions 2 and 3 of LDAP. Most software included in the Directory Server uses UTF-8 internally and at interfaces other than LDAP (for example in command-line parameters and LDIF files).
The NT
Synchronization Server, installed with the Directory Server, converts
UTF-8 to and from NT's Unicode representation (UCS-2).
|
|
|
|
Netscape Communicator and Netscape browsers support UTF-8.
|
|
|
|
|
The gateway can output web pages in many character sets. The gateway selects a character set for each HTTP client based on a combination of input from the client and from the gateway's configuration files. The gateway selects a character set for transmission according to this priority:
charset parameter.
When a client includes more than one character set in a request header, and the gateway supports more than one of these, it selects a character set according to this priority:
Browsers designed for localization are configured to request the UTF-8 character set by default. To support localization, the gateway is preconfigured to transmit the UTF-8 character set to these clients: Netscape Communicator and Internet Explorer. The gateway allows this preconfiguration to be overridden using the ignoreAcceptCharsetFrom parameter. For more information about this parameter, see ignoreAcceptCharsetFrom.
The conversion from UTF-8 to the gateway client's chosen character set is performed shortly before output.
For browsers that do
not request UTF-8 by default, the gateway selects
a character set from the Accept-Charset request header or
from the Accept-Language request header,
depending on the HTTP client.
Some HTTP clients
don't request any character set information. For these clients, the
gateway's charset parameter definition
is the default. When the charset parameter is not
defined in the dsgw.conf file, the gateway
uses Latin-1 (which is the default in HTTP).
In addition to UTF-8 and Latin-1, the gateway can convert to and from several national character sets, depending on the client's needs and configuration, including the following:
The following sections describe how special characters are interpreted by the gateway:
If the client's character set lacks a character for non-breaking space, but has ideographic space, non-breaking spaces are converted to ideographic spaces before charset conversion.
See the changeHTML directive, in the gateway configuration file dsgw.conf.
When the gateway needs to embed a UTF-8 string in an URL, it encodes it in a query string (the query string is the part of the URL that follows the question mark).
This works around a
problem with Japanese NT, which garbles environment variables that are
in UTF-8 (or any charset except Shift_JIS).
The Web server passes information to the gateway CGI programs in
environment variables, but the query string environment variable $QUERY_STRING is URL-encoded, so
it can handle UTF-8 (from Windows' point of view, it's ASCII).
The gateway's default language is US English.
A single gateway instance supports clients in multiple locales concurrently.
Support for multiple locales is accomplished by translating documentation (including online help), the string resource database, and the configuration and HTML template files. A single copy of the compiled code handles all supported locales.
Locale-dependent information is stored in translated files stored in subdirectories identifying the locale name. These editable files are stored separately from the gateway code. For example, the German translation of config/search.html is stored in config/de/search.html, the French translation is stored in config/fr/search.html, and the Japanese translation is stored in config/ja/search.html.
The default gateway can be configured to support locales in addition to English (the default locale), French, German, Spanish, and Japanese. This is part of the overall localization effort, which includes localizing all the configuration and HTML files, including the online help and the string resource database. This is made possible by including a pointer to the mapping table in the dsgw-l10n.conf file, which is stored during Directory Server installation in the lang directory:
serverRoot/clients/dsgw/config/lang
dsgw-l10n.conf provides translation
in the Search and Advanced Search pull-down menus for the default
gateway (dsgw.conf). If dsgw-110n.conf
is not present
in the /config/lang directory,
translation of the UI does not occur and English characters appear in
the pull-down menus for Standard Search and Advanced Search.
The following example
shows how to create a new locale using Chinese as the language for
translation:
|
|
|
|
If you are using the US version of the gateway, dsgw.conf contains a sample of dsgw-l10n.conf. |
|
|
|
|
| Previous |
Contents |
Index |
DocHome | Next |
Last Updated November 26, 2004