fabian-hiller / valibot

The modular and type safe schema library for validating structural data 🤖
https://valibot.dev
MIT License
5.6k stars 169 forks source link

Email validation not allowing specific letters (danish letters) #675

Closed Appz-dk closed 1 week ago

Appz-dk commented 1 week ago

Not sure if this should even be addressed as the vowels are not part of ASCII-only characters practice.

EmailSchema = v.pipe(v.string(), v.nonEmpty('Please enter your email.'), v.email('Incorrect email format.'));

This email schema invalidates emails if any of the 'special' danish vowel are present in the email 'æøå' which is not ideal, but is understandable.

'my.næme@gmail.com' would be invalid with the error 'Incorrect email format'

I have solved my issue by creating a v.custom email validation for this specific use case.

Appz-dk commented 1 week ago

I think this issue should not be solved by you as it is a very specific use case and not something that should be changed on your part.

fabian-hiller commented 1 week ago

I recommend using regex instead of custom. You can also have a look at #204.

Appz-dk commented 1 week ago

@fabian-hiller Thanks a lot I will look into that