The 'itl2' Resource
The 'itl2' Resource
The 'itl2' resource contains the International Utilities Package
sorting hooks and tables for character type, case conversion, and word
breaks. Each installed script has one or more 'itl2' resources. The resource ID
for each 'itl2' resource is in the script's resource number range. The default
'itl2' resource for a script is specified by the script's 'itlb' resource. Each
'itl2' resource contains
a header with offsets and lengths (beginning with system software
version 7.0) of all the code blocks and tables in the 'itl2' resource
routines and tables for modifying standard string comparison
optional character type tables for use by a script system's CharType
function (beginning with system software version 6.0.4)
optional tables for case conversion and stripping diacritical marks,
for use by a script system's Transliterate function, by the
LwrText procedure (beginning with system software version
6.0.4), and by the LowerText, UpperText, StripText, and
StripUpperText procedures (beginning with system software
version 7.0)
These tables only need to be present for single-byte script systems.
word break tables for the FindWord procedure
Beginning with system software version 6.0.4, the word break tables
used by the Roman FindWord procedure are included in the 'itl2'
resource. Beginning with system software version 7.0, the word break
tables for all scripts are located in each script's 'itl2' resource
an optional new table that provides information on the location of
Roman characters in a non-Roman font to be used by the Roman version
of the FindScriptRun function (beginning with system software
version 7.0)
Note: In addition to these changes, the U.S. 'itl2' resource available
with system software version 7.0 includes word break tables that use
the new state table format for the NFindWord procedure and that
support cedilla, double-acute accent, ogonek, and hacek as letter
characters.
If you do not have access to the Rez file SysTypes.r, which contains the new
'itl2' template, consult Macintosh Developer Technical Support for details.
The Script Manager's CharType, Transliterate, and (before system
software version 7.0) FindWord routines are implemented by each script
system, and the implementation details may be different in each case. Before
system software version 6.0.4, the Roman versions of CharType,
Transliterate, and FindWord used tables that were built into the code;
consequently, these tables could not be localized to reflect language-specific or
region-specific differences in uppercase conventions and word boundaries. The
old LwrText and LwrString routines used the case conversion tables from
the Roman version of Transliterate.
With system software version 6.0.4, the tables used by LwrText and
LwrString and by the Roman Script System versions of CharType,
Transliterate, and FindWord were removed from the code and added to the
'itl2' resource, and the Roman versions of these routines have been modified to
get their tables from the 'itl2' resource (using the IUGetIntl function).
The advantages of the relocation of these tables include increased
localizability of character type assignments, word break definitions, and case
conversion (primarily for accented Roman characters). For example, the
handling of accents when lowercase characters are converted to uppercase
characters depends on language and region, but these tables were not
previously localizable on a region-by-region basis.
Warning: Since system software version 6.0.4, LwrString and some
script versions of CharType, Transliterate, and FindWord have gained
access to the 'itl2' resource by using the IUGetIntl function. The relocation of
the tables used by these routines may cause the following problems:
If IUGetIntl needs to load 'itl2', it may cause memory to move. As a
result, some of these routines that previously had no effect on memory
may now cause memory to move. (The CharType function is the only
one of these that was specified as a routine that would not move
memory.)
To get the correct tables, the Script Manager examines the current
font of the current grafPort. As a result, LwrString now depends on
the A5 register specifying the current grafPort and the font being set
correctly, whereas previously it never depended on A5.
Note: Before system software version 7.0, LwrText was the
high-level interface to the LwrString trap. Although this name is
still available in version 7.0, the recommended name is now
LowerText for both high-level and assembly-language users.