### 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 the locale key is a valid host locale key, it creates a host-specific collation object.
- If the locale key is not a host locale key but represents a portable locale, it creates a portable collation object.
- If the locale key doesn't represent a valid host or portable locale, the function throws an exception.
- If you don't specify a locale key, the function returns the default collation object for the current locale.

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

Collation Classes
Locale Names