4 ms·
> Every case comparison using lower() instead of casefold() can be considered a bug. If you just casefold two strings and compare them, it's still a bug. You n
by Alex3917 6y ago
> Every case comparison using lower() instead of casefold() can be considered a bug.
If you just casefold two strings and compare them, it's still a bug. You need to normalize them to NFKC first.
- pas 6y agoIs NFKC necessary, isn't NFKD enough? (As in you have to normalize and decompose both strings, but at that point you can check them for equality, and doing the canonical composition isn't needed, right?)
- Alex3917 6y agoI think that would work if you're just checking for equality and want to minimize processing. I guess as a web developer I always just assume people are going to be storing strings in a database after normalizing them, so would want to minimize string length.