To perform case-insensitive comparison of strings, set the ordering strength of the ICollation object to ignore the level of difference represented by a case difference. Generally cases represent a tertiary difference, although this may differ between languages. This means you set the collation object to consider only primary and secondary differences and ignore tertiary differences.
// Create a locale key for the U.S. English locale
ILocaleKey usLoc("EN", "US");
// Create the collation object
ICollation* order = ICollation::createCollation(usLoc,
ICollation::kSecondaryDifference);
int result = order->compare(text1, text2);
if (result == ICollation::kSourceEqual)
// strings are equal or only have case differences
else
// strings are not equal
delete order;
![]()
Overview of Locale Classes
Locale Names
Collation Classes
Ordering
Strength