Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email with UTF-8 characters #275

Open
1oglop1 opened this issue Oct 18, 2023 · 1 comment
Open

Email with UTF-8 characters #275

1oglop1 opened this issue Oct 18, 2023 · 1 comment

Comments

@1oglop1
Copy link

1oglop1 commented Oct 18, 2023

Hi, I was comparing this crate with email_address crate

And I have an email with a controversial character � - https://en.wikipedia.org/wiki/Specials_(Unicode_block)
Then email_address and validator do not agree if it is valid or not abc�def@example.com

let email = "abc�def@example.com";
EmailAddress::from_str(email).is_ok(); // true
validator::validate_email(email);  // false

According to RFC6531 - UTF-8 characters should be allowed in the email however, it is often not very practical.

Perhaps the solution could be adding some parse options to the email validator.
Probably the best thing for the community would be to have just one crate for email validation and cooperation between email_address and validator.

Refs:

@Keats
Copy link
Owner

Keats commented Oct 18, 2023

Our validation is very simple: https://github.com/Keats/validator/blob/master/validator/src/validation/email.rs#L8-L18 we just use whatever the HTML spec allows. So it will reject potentially valid email addresses as indicated in a comment in those lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants