The following figure shows the relationship between localized messages, locales, and character sets:The Common Language Data Types (CLDT) subsystem provides the class Locale to help determine the current language and territory. These values can be obtained by evaluating Locale current language and Locale current territory. The language and territory of a localized message determine what message text should be displayed.A coded character set defines a mapping between code points (Characters) and glyphs. A character set, in conjunction with a locale, also defines the semantic value of a Character (for example, whether the Character is uppercase, lowercase, a digit, or so on).The translation of code points into their visual representation might necessitate that a single localized message for a particular locale be stored separately for each supported character set. Consider the font '-microsoft-courier new-bold-i-normal-0-0-96-96-m-0-iso8859-1,' whose character set is 'iso8859-1.' In this font, the character with the graphical representation à is associated with the code point 224 (Character value: 224). In character set 'ibm-437' the same visual representation is associated with the code point 133 (Character value: 133). Thus, in order to display the text "à la mode", a distinct localized message is required for each character set. It is the developer's responsibility to ensure that localized messages are appropriate for the font of the widgets in which they are being displayed.The following code fragment demonstrates how to query a widget for the character set used by its font. This code fragment assumes that the variable aWidget refers to the widget whose font is being queried. Note that if the font being queried does not conform to the X Logical Font Description (XLFD) naming convention the CgLogicalFontDescription>>name: message can answer nil.
|