Convert string to uppercase when comparing after normalizing instead of lowercase

While doing string comparison after normalizing (converting both string to upper case or lower case) we should always use the upper case. Upper case is optimized for normalization.

A small group of characters, when they are converted to lowercase, cannot make a round trip. To make a round trip means to convert the characters from one locale to another locale that represents the same character data differently, and then to accurately retrieve the original characters from the converted characters.

Converting to uppercase rather than lowercase can also prevent incorrect behavior in certain cultures. For example, in Turkish, two lowercase i's map to the same uppercase I.

Vikram

No Comments