3 ms·
If you're going to allow unicode usernames then you should casefold them rather than lowercasing them before normalizing as NFKC. I wanted to stay out of the P
by ubernostrum 9y ago
If you're going to allow unicode usernames then you should casefold them rather than lowercasing them before normalizing as NFKC.
I wanted to stay out of the Python 2 vs. 3 quagmire in this article, but it's worth knowing that in Python 3.3+, strings have a 'casefold()' method:
https://docs.python.org/3/library/stdtypes.html#str.casefold https://docs.python.org/3/library/stdtypes.html#str.casefold
Unfortunately, since Python 2 still has around two years of upstream support before EOL, I can't universally recommend people just use 'casefold()', no matter how much I'd like to.