24.05.2014 Views

AIX Version 4.3 Differences Guide

AIX Version 4.3 Differences Guide

AIX Version 4.3 Differences Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

abandoning its standards-based internationalization support, ULS will add<br />

support for a set of UCS locales as an extension to the existing<br />

internationalization language support.<br />

10.3.3 Universal Locale<br />

The Universal Locale is a method of using Unicode as a wchar_t or wide<br />

character encoding. As mentioned earlier, Unicode is based on a 16-bit encoding,<br />

whereas an ASCII character is based on an a 7-bit encoding.<br />

For <strong>AIX</strong> to use Unicode across the entire system, it uses the UTF-8 encoding for<br />

files and uses Unicode as the process code. Process code is the actual code that<br />

is being executed in memory.<br />

Note: All supported locales will function correctly in both their current code as<br />

well as UTF-8.<br />

10.3.3.1 Locale Definitions<br />

The following can be said about locale definitions:<br />

• Unicode-based locales must be compiled based on a UTF-8 charmap<br />

containing all characters currently defined in Unicode 2.0. The names for such<br />

characters must be the exact character names as outlined in the standard,<br />

with any spaces imbedded in the character name changed to underscores. For<br />

example, the correct symbol name for the Unicode value U+00A1 would be<br />

.<br />

• Character symbol names that are currently required to be defined by the<br />

localedef command must be defined with both the Unicode and POSIX symbol<br />

names in the charmap. For example, the value U+0041 would be defined as<br />

both and .<br />

• To ensure that multiple locales can be built from a given locale, all existing<br />

charmaps must be modified to use the Unicode names. Each charmap will<br />

define only those actually contained within the code set.<br />

Many of the locale definitions have similar characteristics across multiple locales,<br />

especially in the LC_CTYPE section. From a maintenance perspective, it is highly<br />

desirable to be able to maintain a common source for these and allow them to<br />

have an include facility. The C preprocessor can be used for this purpose,<br />

provided that the localedef comment character and escape character (line<br />

continuation) be changed to values that do not conflict with the C preprocessor.<br />

Currently, the default comment character for locales is "#", and the default<br />

continuation character is "\". By changing these to "*" and "/", respectively, you<br />

can use C preprocessor directives in the context of a localedef source file, such<br />

as #include and #ifdef statements to tailor the locale definition based on the<br />

characters available in the codeset. Thus, before running localedef, each locale<br />

source is run through the C preprocessor with the code set name to be used<br />

specified as an option to the C preprocessor through -D on the command line. For<br />

example, suppose your locale definition was to be compiled with four different<br />

code sets, ISO8859-1 (Latin), ISO8859-5 (Cyrillic), ISO8859-7 (Greek), and<br />

UTF-8 (Unicode). Moreover, suppose that in the LC_CTYPE section you wanted<br />

to declare the following three characters as uppercase:<br />

<br />

244 <strong>AIX</strong> <strong>Version</strong> <strong>4.3</strong> <strong>Differences</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!