3 ms·
Practically speaking, you have to treat email addresses as case-preserving: you match case-insensitive, but you always store the case the user entered in direct
by jcranmer 7y ago
Practically speaking, you have to treat email addresses as case-preserving: you match case-insensitive, but you always store the case the user entered in directly.
I usually give my email address as starting with a capital letter for historical reasons, and I once had an issue that wouldn't let me log on with any case whatsoever, probably because it lowercased the email address and tried to match it against the uppercase in the database.
- Alex3917 7y ago> you match case-insensitive, but you always store the case the user entered in directly. You still need to normalize the unicode for either search or display, unless you're only allowing ascii or something. E.g. for the column you store for search and to guarantee uniqueness, casefold and then normalize to NFKC. And for the column you store for display, normalize to NFC. (And obviously you need to sanitize user input before doing anything.)