Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Text /
Appendix A - Built-in Script Support / The Roman Script System


Standard Sorting Routines

The standard Macintosh sorting routines are contained in the Pack 6 resource, a system code resource (type = 'PACK', ID = 6) initialized at startup. As they process each character or sorting unit, the standard routines first call equivalent routines in the current script system's string-manipulation ('itl2') resource. Those routines, called sorting hooks, are described with the string-manipulation resource in the appendix "International Resources" in this book.

The U.S. string-manipulation ('itl2') resource contains only empty sorting hooks. Other localized versions of the Roman script system--and non-Roman script systems--provide their own string-manipulation resources that may have nonempty routines to modify or replace any of the standard routines, on a character-by-character basis.

Table A-8 describes the sorting behavior implemented by the standard Macintosh sorting routines. All characters of the Standard Roman character set are sorted. Primary sorting is shown in vertical order; secondary sorting is horizontal. This is the default sorting behavior used by the Text Utilities, and is appropriate for U.S. and similar localized versions of the Roman script system. All Text Utilities sorting routines (other than RelString and EqualString) use the sorting behavior specified in the string-manipulation resource, which may or may not be identical to the standard behavior. (RelString and EqualString use an invariant sorting behavior that is described in the chapter "Text Utilities" in this book.)
Table A-8 Standard sorting order (for Standard Roman character set) (Continued)
PrimarySecondary
$00NUL
... 
$1FUS
$20space ($20) non-breaking space ($CA)
$21!
$22" << ($C7) \xAA ($C8) " ($D2) " ($D3)
$23#
$24$
$25%
$26&
$27' ' ($D4) ' ($D5)
$28(
... 
$40@
$41A Á À Â Ä Ã Å a á à â ä ã å
$42B b
$43C Ç c ç
$44D d
$45E É È Ê Ë e é è ê ë
... 
$49I Í Ì Î Ï i \xFB í ì î ï
... 
$4EN Ñ n ñ
$4FO Ó Ò Ô Ö Õ Ø o ó ò ô ö õ ø
... 
$55U Ú Ù Û Ü u ú ù û ü
... 
$59Y y ÿ \xE7
$5AZ z
$5B[
... 
$60`
$7B{
... 
$7FDEL
$A0 
... 

Low-ASCII characters (other than letters) not listed in Table A-8 have primary sorting only and are sorted according to numeric code. Low-ASCII letters not listed in Table A-8 have a primary sorting order that is alphabetical and a secondary sorting order of uppercase followed by lowercase (like "B b"). All characters with codes above $A0 that are not listed in Table A-8 are sorted after $A0 according to numeric character code (except for ligatures; see note on sorting of ligatures).

Note the following details and anomalies in the standard Macintosh sorting order:

Sorting of ligatures
For a ligature, the primary sorting position is equivalent to the separate characters that make up the ligature. The secondary sorting position is just following the equivalent separate characters. Ligatures are sorted by the following first and second characters:
Ligature
First
character
Second
character
ÆAE
æae
\xDEfi
\x9Cfl
\xEBOE
\xB6oe
ßss

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996