Types of sorts

There are many ways to sort characters. Open Client and Open Server collating sequence file can use one or more of the types of sorts listed in Table 6-1:

Table 6-1: Types of sort orders

Type of sort

Description

Single-level

Characters sort according to their primary sort order value.

A character that appears on a line higher in the vertical list of “char=” entries always sorts before a character that appears on a line lower in the list.

Two-level

Characters sort according to their primary and secondary sort order values. If all the characters in two strings have the same primary sort values, then the characters’ secondary sort values are used to break the ordering tie.

If two characters appear on the same “char =” line, the one furthest to the left sorts first.

For example, suppose a sort order file contains:

char = A,a,Ä,ä char = B,b char = C,c,Ç,ç

Some strings using these characters would sort as follows:

ABC ÄBC äbc acb äcb

Because the strings ABC, ÄBC, and äbc have the same primary values, they are ordered by their secondary sort values. acb and äcb are similarly sorted according to secondary values. äbc is ranked before acb because b has an earlier primary value than c.

One-to-two

A single character that is sorted as multiple characters is called a ligature. For example, the German character “ß” is sorted as “ss.”

Two-to-one

A 2-character string that is sorted as 1 character is called a sort double. For example, the Spanish character string “ch” is sorted as one character that comes between “c” and “d”.