Instantiating a Collation Object

ICollation is an abstract class that provides the standard interfaces for all collation operations. Subclasses of ICollation provide both host-specific and portable collation objects for specific natural languages. IBitwiseCollation is a special portable collation object that provides simple, language-insensitive comparison of Unicode values.

By using the collation classes in conjunction with the locale mechanism, you can implement text sorting and searching features that will work correctly in any user's natural language without needing to know the specific requirements of that language. To create a language-sensitive collation object, call the ICollation::createCollation function. You pass in the locale key corresponding to the language (or more specific locale) of the text you want to collate. For example, to get the standard collation for English:

ICollation* order = 
ICollation::createCollation(ILocaleKey("EN"));

If you use the locale key, createCollation returns the best collation object:

If you only want to use a portable collation object, you can instantiate it directly by using the IPortableCollation class.



Collation Classes
Locale Names