Sorting

There's not a lot to say about sorting per se, as you can use any sorting algorithm to sort a list of Unicode strings. A number of things are worth keeping in mind, however.[6]

[6] Much of the material in this section comes from the Davis paper, op. cit. and from UTS #10.

Collation Strength and Secondary Keys

First, it's worth thinking a little about your sort algorithm and what it does with keys that compare as equal. Sort algorithms such as the bubble and insertion sorts are stable: Records with identical keys will remain in the order of their original insertion after sorting the list. Fast sort algorithms such as the Quicksort and the merge sort are generally unstable: Records with identical keys are not preserved in insertion order ...

Get Unicode Demystified now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.