Add support for Internationalized Domain Names (IDN)

Created on 3 April 2019, over 5 years ago
Updated 30 January 2023, over 1 year ago

Problem/Motivation

Internationalizing Domain Names in Applications (IDNA) is a mechanism that has been around for a few years now and is based on multiple RFCs to allow the usage of domain names containing non-ASCII characters.

Relevant RFCs are the following (taken from https://uasg.tech):
Internationalized Domain Names for Applications (IDNA):Definitions and Document Framework
https://tools.ietf.org/html/rfc5890
Internationalized Domain Names in Applications (IDNA): Protocol
https://tools.ietf.org/html/rfc5891
The Unicode Code Points andInternationalized Domain Names for Applications (IDNA)
https://tools.ietf.org/html/rfc5892
Right-to-Left Scripts forInternationalized Domain Names for Applications (IDNA)
https://tools.ietf.org/html/rfc5893
Internationalized Domain Names for Applications (IDNA): Background, Explanation, and Rationale
https://tools.ietf.org/html/rfc5894
Mapping Characters forInternationalized Domain Names in Applications (IDNA) 2008
https://tools.ietf.org/html/rfc5895

Drupal 7 && Drupal 8/9
The current implementation of Drupal's URL syntax verifier valid_url() / UrlHelper::isValid() does only support 5 out of 19 examples for Internationalized Domain Names defined by the Universal Acceptance Steering Group (https://uasg.tech/).

Drupal 9
Although we are already shipping with the Symfony Url constraint which supports all these cases, we are still using a custom implementation that fails in many valid cases.

Example internationalized domain names and the validity in D7/D8:

References:
https://tools.ietf.org/html/rfc3986
https://uasg.tech/
https://en.wikipedia.org/wiki/Internationalized_domain_name
https://www.icann.org/resources/pages/idn-2012-02-25-en
https://bgp.he.net/report/dns#_alltlds

Proposed resolution

Drupal 9
* Use Symfony's Url Constraint for validation.
Drupal 7
@todo

Remaining tasks

Drupal 9

  • Patch Drupal core to use Symfony's Url Constraint
  • Review
  • Create release notes snippet

Drupal 7
@todo

User interface changes

none

API changes

none

Data model changes

none

Release notes snippet

Original report by [username]

Feature request
Status

Needs work

Version

10.1

Component
Base 

Last updated 43 minutes ago

Created by

🇩🇪Germany sanduhrs 🇪🇺 Heidelberg, Germany, Europe

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Production build 0.71.5 2024