﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33968	Make EmailValidator and URLValidator IDNA 2008 compliant	j-bernard	nobody	"This ticket is the second of a list of tickets aiming at bringing Email Address Internationalization (EAI) compliance to Django by supporting International Domain Name (IDN) with regards to the latest standard (IDNA 2008) and fixing some processing on internationalized domains or email addresses.
Previous ticket: #33967

Domain validation is not fully compliant with IDNA 2008 (either in EmailValidator or UrlValidator) as defined in [https://datatracker.ietf.org/doc/html/rfc5891#section-4.2 RFC5891 section-4.2]

A domain name cannot be validated properly with a regex, therefore, an IDN validation should be performed with an appropriate library.

The current validation ignores IDNA errors. Instead, IDNA should be used for domain validation and the regex validation should be skipped for domains as it may lack some specific rules and then end up with invalid domains being accepted. 

Moreover, the current validation is made by performing a conversion to A-Label with the Python `encodings.idna` module which implements a deprecated standard (IDNA 2003).

This conversion should be made IDNA 2008 compliant. The most used Python IDNA 2008 package is [https://pypi.org/project/idna/ idna], which is among the most downloaded Python packages according to PyPI (4th as for the current month) and referred in the [https://docs.python.org/3/library/codecs.html#module-encodings.idna official Python documentation].
"	New feature	closed	Core (Other)	4.0	Normal	wontfix	IDNA EAI EmailValidator UrlValidator RFC	Florian Apolloner	Unreviewed	0	0	0	0	0	0
