Compare two strings for canonical equivalence. Further options include
case-insensitive comparison and codepoint order (as opposed to code
unit order).
Canonical equivalence between two strings is defined as their
normalized forms (
NFD or
NFC) being identical. This
function compares strings incrementally instead of normalizing (and
optionally case-folding) both strings entirely, improving performance
significantly.
Bulk normalization is only necessary if the strings do not fulfill the
FCD conditions. Only in this case, and only if the strings are
relatively long, is memory allocated temporarily. For
FCD
strings and short non-
FCD strings there is no memory
allocation.