Language-Insensitive String Comparison

Of course, you don't always want language-sensitive string comparison. After all, it's complicated and, no matter how much you optimize it, it'll never be as fast as binary comparison. Of course, if binary comparison gives the wrong answer, its speed doesn't matter. Sometimes, however, you don't care about linguistically correct ordering. You just want some kind of ordering, and the user will never see the results of that ordering.

There are two classical versions of this problem. In the first case, you care only about whether two strings are equal. If they aren't, you're not interested in which one comes first. “Equal” can also be a language-sensitive issue, but if you're dealing with non-natural-language ...

Get Unicode Demystified now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.