rfc-3987

Internationalized Resource Identifiers (IRIs)

M. Duerst, M. Suignard
date2005-01 streamIETF wgnon working group statusPROPOSED STANDARD pages46 canonicalhttps://www.rfc-editor.org/rfc/rfc3987 doi10.17487/RFC3987 errataview
This document defines a new protocol element, the Internationalized Resource Identifier (IRI), as a complement of the Uniform Resource Identifier (URI). An IRI is a sequence of characters from the Universal Character Set (Unicode/ISO 10646). A mapping from IRIs to URIs is defined, which means that IRIs can be used instead of URIs, where appropriate, to identify resources. The approach of defining a new protocol element was chosen instead of extending or changing the definition of URIs. This was done in order to allow a clear distinction and to avoid incompatibilities with existing software. Guidelines are provided for the use and deployment of IRIs in various protocols, formats, and software components that currently deal with URIs.

Extracted elements (29)

design-rationale §1.1

A new protocol element (IRI) was defined instead of extending or changing the URI definition in order to allow a clear distinction and to avoid incompatibilities with existing software that processes URIs; IRIs serve as 'presentation elements' for URI 'protocol elements'.

ip

design-rationale §4.2

Bidi restrictions on IRI components (SHOULD NOT mix rtl and ltr characters; rtl components SHOULD start and end with rtl characters) are given as SHOULDs rather than MUSTs because for IRIs never presented visually they are irrelevant, but for general IRIs they are critical for consistent visual-to-logical round-tripping.

ip

design-rationale §5.3.2.2

IRI equivalence relies on pre-normalized (NFC) storage rather than normalizing at comparison time because it is unknown how a particular sequence of characters is being treated, and third-party normalization could silently alter identifiers in ways that change their meaning.

ip

design-rationale §3.2

UTF-8 is required as the sole encoding for IRI-to-URI conversion (and URI-to-IRI conversion) because using any other encoding would make round-trip identity impossible: decoding iso-8859-1 percent-encoded sequences produces a different URI when the result is later re-encoded as UTF-8.

ip, crypto

interoperability-note §3.1

For schemes that use domain names in ireg-name and do not allow percent-encoding there, systems MAY apply the ToASCII operation (RFC 3490) to ireg-name before step 2 of IRI-to-URI mapping; this SHOULD be done when maximizing interoperability with legacy URI resolvers.

ip, dns

interoperability-note §1.2

IRIs may be used in place of URIs only when: (a) the protocol or format element is explicitly designated to carry IRIs, (b) the carrying protocol/format has a mechanism to represent the wide range of IRI characters, and (c) the corresponding URI encodes original characters into octets using UTF-8.

ip

interoperability-note §5.3.3

Validated IDN components of IRIs SHOULD be character-normalized using the Nameprep process (RFC 3491) for scheme-based normalization, but SHOULD NOT be converted into ACE (punycode) form for legibility. Scheme-based normalization may treat an IDN and its punycode equivalent as equivalent.

ip, dns

normative-requirement §5.2 REQUIRED

Any kind of IRI comparison REQUIRES that all escapings or encodings in the protocol or format carrying the IRI (e.g., XML numeric character references, HTTP Transfer Codings) be resolved before comparison.

ip

normative-requirement §3.1 MUST

Applications MUST map IRIs to URIs using a two-step procedure: (1) generate a NFC-normalized UCS character sequence from the input IRI (with variant handling for paper/non-Unicode/Unicode-encoded inputs), then (2) convert each ucschar or iprivate character to its UTF-8 octet sequence and percent-encode each octet as %HH.

ip

normative-requirement §5.1 MUST

Applications using IRIs as identity tokens with no relationship to a protocol MUST use Simple String Comparison (section 5.3.1); all other applications MUST select one of the comparison practices from the Comparison Ladder.

ip

normative-requirement §4.3 MUST

Bidi input methods MUST generate Bidi IRIs in logical order while rendering them per section 4.1; rendering SHOULD be updated after every new character is input to avoid end-user confusion.

ip

normative-requirement §4.1 MUST

Bidirectional IRIs MUST be rendered using the Unicode Bidirectional Algorithm [UNIV4][UNI9], specifically as if preceded by U+202A (LEFT-TO-RIGHT EMBEDDING) and followed by U+202C (POP DIRECTIONAL FORMATTING), unless the display is identical without the embedding.

ip

normative-requirement §2.1 MUST NOT

Characters outside the US-ASCII repertoire are not reserved and therefore MUST NOT be used for syntactical purposes such as delimiting components in newly defined schemes, because they fall in the 'iunreserved' category.

ip, security

normative-requirement §3.2 MUST NOT

Conversions from URIs to IRIs MUST NOT use any character encoding other than UTF-8 in steps 3 and 4, even if context suggests another encoding was originally used in the URI (e.g., iso-8859-1 percent-encoded sequences must not be decoded as non-UTF-8).

ip

normative-requirement §5.3.2.2 MUST

Equivalence of IRIs MUST rely on the assumption that IRIs are appropriately pre-character-normalized (NFC) rather than applying normalization at comparison time. In cases of non-digital or non-UCS-based input, NFC MUST be used; IRIs SHOULD be created using NFC.

ip

normative-requirement §4.1 MUST NOT

Higher-level protocol changes to Unicode Bidirectional Algorithm rendering MUST NOT be used if they change the rendering of IRIs.

ip

normative-requirement §6.3 MUST

In documents with a native character encoding, IRIs MUST be encoded in that encoding; if it is not UTF-8, IRIs MUST NOT be placed into the document in UTF-8 encoding. IRI characters not expressible in the native encoding SHOULD be escaped using the document format's escaping conventions.

ip

normative-requirement §4.1 MUST NOT

IRIs MUST NOT contain bidirectional formatting characters (LRM, RLM, LRE, RLE, LRO, RLO, and PDF); such characters affect visual rendering but cannot be correctly input as part of an IRI.

ip, security

normative-requirement §6.2 MUST

Software interfaces and protocols that handle IRIs MUST define which character encoding is used. Intermediate software between IRI-capable and URI-only components MUST map IRIs to URIs per section 3.1 when transferring data; this mapping SHOULD be applied as late as possible.

ip, interoperability-note

normative-requirement §5.3.1 MUST NOT

When comparing IRIs character by character, the comparison function MUST NOT map IRIs to URIs, as such a mapping would create spurious equivalences. An IRI SHOULD NOT be modified when transported if there is any chance it might be used as an identifier.

ip

normative-requirement §3.1 SHOULD

When percent-encoding octets during IRI-to-URI conversion, the hexadecimal notation SHOULD use uppercase letters for digits A–F to reduce variability.

ip

normative-requirement §4.1 MUST

When stored or transmitted digitally, bidirectional IRIs MUST be in full logical order and MUST conform to the IRI syntax rules, ensuring they can be processed the same way as other IRIs.

ip

protocol-element §2.1

An IRI (Internationalized Resource Identifier) is a sequence of characters from the Universal Character Set (Unicode/ISO 10646) that extends URI syntax by adding UCS characters beyond U+007F to the unreserved character class, while keeping the same component structure and reserved character semantics as RFC 3986 URIs.

ip, security

security-consideration §8

Because some percent-encodings cannot be unambiguously decoded (e.g., %FC could be iso-8859-1 or iso-8859-5), URI-to-IRI conversion that guesses encodings can create IRIs that re-encode to a different URI, breaking identity. This is why only UTF-8 is permitted for URI-to-IRI conversion.

security, ip

security-consideration §8

Bidirectional IRIs allow display of an IRI in a way that differs from its logical storage, enabling spoofing: an attacker could present a visually harmless IRI whose logical (transmitted) form is a different, malicious identifier. Section 4 restrictions mitigate but do not eliminate this risk.

security, ip

security-consideration §7.3

Software automatically detecting IRIs in plain text must not treat a non-ASCII character as the end of an IRI, and must correctly transcode the detected IRI from the document's character encoding to the system-wide invocation mechanism's encoding, otherwise the wrong resource may be retrieved.

security, ip

security-consideration §8

The UCS contains many visually similar characters (e.g., Latin 'A', Greek Alpha, Cyrillic 'A') that can be used to construct IRIs that look identical to legitimate IRIs but resolve to different resources (homograph/spoofing attacks). IRIs should use characters from a single script within each component.

security, ip

wire-format §2.2

The top-level IRI ABNF is: IRI = scheme ":" ihier-part [ "?" iquery ] [ "#" ifragment ]. IRI-reference = IRI / irelative-ref. The grammar closely follows RFC 3986 with non-terminals renamed (URI→IRI or prefixed 'i') wherever the unreserved set is expanded.

ip

wire-format §2.2

The 'ucschar' production defines the Unicode code point ranges permitted in IRI unreserved characters: %xA0-D7FF, %xF900-FDCF, %xFDF0-FFEF, and the ranges %x10000-1FFFD through %xE1000-EFFFD (successive 0x10000-wide planes). The 'iprivate' production covers %xE000-F8FF, %xF0000-FFFFD, and %x100000-10FFFD (private-use areas), allowed only in iquery.

ip