Are email addresses allowed to contain non-alphanu

2020-01-27 03:20发布

I'm building a website using Django. The website could have a significant number of users from non-English speaking countries.

I just want to know if there are any technical restrictions on what types of characters an email address could contain.

Are email addresses only allowed to contain English letters, numbers, _, @ and .?

Are they allowed to contain non-English alphabets like é or ü?

Are they allowed to contain Chinese or Japanese or other Unicode characters?

7条回答
孤傲高冷的网名
2楼-- · 2020-01-27 03:54

I have encountered email addresses with single quotes, and not infrequently either. We reject whitespace (though strictly speaking it is allowed), more than one '@' sign and address strings shorter than five characters in total. I believe this solves more problems than it creates, and so far over ten years and several hundred thousand addresses it's worked to reject many garbage addresses. Also there is a trigger to downcase all email addresses on insert or update.

That being said it is impossible to validate an email without a round trip to the owner, but at least we can reject data that is extremely suspect.

查看更多
登录 后发表回答