Performing Bitwise String Comparison

IBitwiseCollation performs bitwise (language-insensitive) string comparison, directly comparing the Unicode double-byte character values. Double-byte character sets are used for handling languages such as Japanese, Chinese, and Korean, which contain more symbols than can be represented by the 256 characters of the single-byte character set.

To perform a bitwise comparison:

  1. Create an IBitwiseCollation object. You can either create the IBitwiseCollation object directly from the IBitwiseCollation constructor, or call ICollation::createCollation, passing in the POSIX ("C") locale.
  2. Use compare or one of the helper functions isEqual, isGreaterThan, or isLessThan to compare the strings.

For example:

// Create a locale key for the POSIX locale

ILocaleKey cLocale("C");

// Create the IBitwiseCollation object

ICollation* order = ICollation::createCollation(cLocale);

if (order->isEqual(text1, text2))

	// strings are equal

else

	// strings are not equal

delete order;

Specifying an ordering strength has no effect on the comparison results when using IBitwiseCollation.



Overview of Locale Classes
Locale Names
Collation Classes
Ordering Strength
DBCS and National Language Support
Double-Byte Character Set Support