email-validator.dart icon indicating copy to clipboard operation
email-validator.dart copied to clipboard

Invalid validation when user input email address in other languages like persian

Open zamaniafshar opened this issue 1 year ago • 1 comments

First of all, thanks for creating such a wonderful package. I'm not sure if it's really an issue or not, and I just want to help this package get better. When testing the package with emails like [email protected] or [email protected], everything is fine. However, when giving the package inputs like:

ایمیل@جیمیل.کام

it returns true. In my case, I don't want to accept such emails in my program. I'm not sure if there is any email address like this or not, but I have never seen one. The above inputs are written in the Persian language, and the package only checks the pattern of an email and doesn't check the language of characters.

zamaniafshar avatar Feb 13 '24 15:02 zamaniafshar

Try setting allowInternational to false (parameter to the validate function)

fredeil avatar Feb 14 '24 08:02 fredeil