Are there any libraries to normalize emails

Sadly I can’t tell, as I was not involved in the process, but only heard a lot about the discussions and helped finding the important bits of the RFC.

And even if, as I know my boss, he did got a good discount in exchange for a product preview that we will need to fake until year’s end :wink:

2 Likes

For a long time, the only way to buy IBM’s speech recognition product for the Mac was from a web page, which would claim that “_” was an illegal character for an email… Then they dropped the product…

1 Like

“normalization” makes sense when there are different forms of presentation for single value. For example - unicode normalization.

For email - that doesn’t make sens (except any characters can be optionally encoded in email).

I see there are some cases where you want to achieve some custom uniqueness constraint on email - like removing + from gmail account, so that you prevent making multiple accounts on your system with single gmail account.

However, in most cases, you cannot get 100% coverage anyway (e.g. you cannot determine whether an email is actually from google mail or not easily - think about custom domain, etc.)

Even “downcasing” may not be a good option as technically, username is case sensitive while domain name is not case sensitive - and you’ll hit the issue when you consuming some identity provider having case-sensitive username.

Please check out Email section of awesome-falsehood as well (for fun :slight_smile: )

1 Like

True story: I once encountered a website that let me register an account with a + in my email/username, but their login page validation told me my username contained invalid characters. I immediately decided I did not need what they offered.

2 Likes

Like my both my name at gmail.com and at overminddl1.com go to the same box. ^.^;

Yeah had issues in the past with that where some site downcased the emails so I never got them on an old system… >.>

Oooo it’s an awesome-list of falsehoods! I always hoped there was one of those! ^.^