-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 validation rejects email with special characters #2205
Comments
On the subject of email regexs...
const a = z.string().email();
a.parse("yo@subdomain.my-domain.com"); returns ZodError: [
{
"validation": "email",
"code": "invalid_string",
"message": "Invalid email",
"path": []
}
] Using Zod Edit - looks like there's a possible fix proposed #2157 |
This is my current workaround:
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Emails with special characters still get rejected. |
EDIT: I just updated to latest (3.22.4) and that fixed this. I have a similar issue with emails that contain multiple subdomains with the first level subdomain (closest to the domain) containing numbers. zod@3.21.4
|
For example info@räucher.de gets rejected because of the "ä".
In Chrome, special characters are automatically converted to ASCII on the client side and back. However, this is not the case with Firefox and Safari. So I have no problems in Chrome browsers, but in the others.
Im using simple z.string().email(), dont want to transform each to ASCII by myself and use my own validator.
The text was updated successfully, but these errors were encountered: