Yes. Maybe it should be a separate module because the codes posted in this thread completely fulfills the thread topic, at least the simple variant of case mapping. Comparing strings in a case-insensitive manner is a different topic.idle wrote: ↑Mon Nov 14, 2022 3:57 am I would need to implement
https://www.unicode.org/Public/UCD/late ... olding.txt
This is full case-folding, where the mapping can have different number of letters. In simple case-folding "ss/Ss/sS/SS" and "ß" is different, because simple case-folding supports only mappings with the same number of letters.
With full case-folding and full case-mapping, the topic becomes even more complicated because some Unicode characters can be created by multiple variants of character combinations. To put these character combinations into a normalized form to then apply case-mapping or case-folding, there are several algorithms for normalization and these algorithms sometimes even have to be run multiple times.
To better understand the complexity, I recommend this documentation:
https://www.w3.org/TR/charmod-norm/