fredeil / email-validator.dart

A simple Dart class for validating email addresses (syntax) without using RegEx :email:
https://pub.dartlang.org/packages/email_validator
MIT License
190 stars 38 forks source link

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

Closed zamaniafshar closed 2 months ago

zamaniafshar commented 7 months ago

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 example@example.com or example@gmail.com, 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.

fredeil commented 7 months ago

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