Locale-specific sorting
The String and Character collation operations use collation ordering for U.S. English on Windows and the ordering for the C locale on X-Motif. You should use the compareString:and: and compareCharacter:and: methods provided by LCCollate to perform locale-specific sorting. You can use a SortedCollection to sort a collection based on the current locale by specifying a sort block that uses the current LCCollate instance. See the following example:
"Warning: do not retrieve the lcCollate from the locale inside the
sort block because if the locale is changed the Sorted Collection
may become inconsistent."
| lcCollate |
lcCollate := Locale current lcCollate.
^SortedCollection sortBlock: [:a :b |
(lcCollate compareString: a and: b) = 2 ].
Last modified date: 01/29/2015