Overview of the Intl Utils Package Routines
Overview of the Intl Utils Package Routines
Some of the International Utilities Package routines are described
briefly in this section. See Accessing the International Resources and
Localizing Dates, Times, and Metric Information for additional
routines. The new routines available with system software version 7.0 are
identified by an asterisk (*).
Comparing Strings
The International Utilities Package includes a number of routines to
compare strings and give their exact sorting relationship or determine
whether or not they are equal. System software version 7.0 includes parallel
forms for the sorting functions IUCompString, IUMagString,
IUEqualString, and IUMagIDString to permit explicit specification of an
'itl2' resource handle. These parallel forms, whose names end with PString,
are in the following list. If this handle is NIL, the routines behave just like the
previous routines that do not permit explicit specification of the handle.
IUCompString Compares two high-level language strings for primary
and secondary ordering and determines whether one is
greater than, less than, or equal to an other
IUCompPString* Compares two high-level language strings for primary
and secondary ordering and determines whether one is
greater than, less than, or equal to another and permits
explicit specification of the 'itl2' resource to be used for
string comparison.
IUMagString Compares two strings defined by a pointer and
character length for primary and secondary ordering
and determines whether one is greater than, less than,
or equal to an other
IUMagPString* Compares two strings defined by a pointer and
character length for primary and secondary ordering
and determines whether one is greater than, less than,
or equal to another and permits explicit specification of
the 'itl2' resource to be used for string comparison
IUEqualString Compares two high-level language strings for equality
in primary ordering only
IUEqualPString* Compares two high-level language strings for equality
in primary ordering only and permits explicit
specification of the 'itl2' resource to be used for string
comparison
IUMagIDString Compares two strings defined by a pointer and
character length for equality in primary ordering only
IUMagIDPString* Compares two strings defined by a pointer and
character length for equality in primary ordering only
and permits explicit specification of the 'itl2' resource
to be used for string comparison
Modifying the Standard String Comparison
To modify the standard string comparison, you need to construct your own
'itl2' resource. You may want to modify the standard string comparison if the
one provided by the International Utilities Package does not meet your
needs or if the string comparison for the language that concerns you is not
available. If you supply an 'itl2' resource in an application, you will need to
call the IUClearCache procedure or call one of the new PString comparison
routines that allow you to pass in a handle to an 'itl2' resource. (See
Accessing the International Resources)
For details on modifying the standard string comparison, consult Macintosh
Developer Technical Support.
Facilitating Interscript Sorting Order
With system software version 7.0, the IUScriptOrder, IULangOrder,
IUStringOrder, and IUTextOrder functions make it easier to sort text
between different scripts. The functions use the special script and language
codes described here and in the following routines:
IUScriptOrder* Given a pair of script codes, indicates in what order the
text in the two scripts should be sorted
IULangOrder* Given a pair of language codes, indicates in what order
the text in the two languages should be sorted
IUStringOrder* Given a pair of strings with a script and language code
for each, indicates the proper sorting order of the
strings
IUTextOrder* Given a pair of strings defined by a pointer and
character length (with a script and language code for
each), indicates the proper sorting order of the strings
The ordering of script and language codes is based on information in the 'itlm'
resource. However, the system script is always sorted first, and scripts that
are not enabled and installed are sorted last.