In a site that is serving content to multiple locales, the property encodingMappings maps the locale-based Page directory names to the actual page encoding of documents in those directories. This mapping uses a set of identifiers found in the relative document path.

The mappings are defined as a list of colon-delimited strings that use the following pattern:

Java Encoding:Identifier1:Identifier2:Identifier3:Identifier4

You must use the IANA (Internet Assigned Numbers Authority) names to specify the encodingMappings property, instead of the canonical Java encoding names. If you do not use the IANA encoding names the encodingMappings incorrectly sets the character set in the header passed to the web server. You can find a complete list of the IANA names at http://www.iana.org/assignments/character-sets.

Example A

In this example, each directory path uses one identifier, en, fr, or ja. In each case, the identifier is used to identify the associated page encoding.

<docroot>/en/...
<docroot>/fr/...
<docroot>/ja/...

The following displays the configuration of the encodingMappings property that corresponds with the directory structure in Example A:

encodingMappings=\
        US-ASCII:en:::,\
        ISO-8859-1:fr:::,\
        Shift_JIS:ja:::
Example B

The keywords used in the directory path do not have to be full directory names, as long as they follow a pattern. In the following example, the same identifiers that were used in Example A are referenced with different directory names:

<docroot>/en-content/...
<docroot>/fr-content/...
<docroot>/ja-content/...

The following displays the configuration of the encodingMappings property that corresponds with the directory structure in Example B.

encodingMappings=\
        US-ASCII:en:::,\
        ISO-8859-1:fr:::,\
        Shift_JIS:ja:::

In Examples A and B, the values for the encodingMappings property are the same. In both cases, only the first identifier is used to identify the encoding.

Example C

The encodingMappings property allows for up to four identifiers to indicate the page encoding of a directory path. Content directories can be as simple as those used in Example A, or more complicated as in the following example:

<docroot>/en_US/...
<docroot>/en_GB/...
<docroot>/en_CA/...
<docroot>/fr_FR/...
<docroot>/fr_CA/...
<docroot>/ja_JP/EUC/...
<docroot>/ja_JP/Shift_JIS/...
<docroot>/ja_JP/JIS/...

The following displays the configuration of the encodingMappings property that corresponds with Example C:

encodingMappings=\
        ASCII:en:US::,\
        ASCII:en:GB::,\
        ASCII:en:CA::,\
        ISO-8859-1:fr:FR::,\
        ISO-8859-1:fr:CA::,\
        EUC_JP:ja:JP:EUC:,\
        Shift_JIS:ja:JP:Shift_JIS:,\
        JIS:ja:JP:JIS: