Internet Engineering Task Force (IETF) J. Klensin Request for Comments: 5894 August 2010 Category: Informational ISSN: 2070-1721 Internationalized Domain Names for Applications (IDNA): Background, Explanation, and Rationale Abstract Several years have passed since the original protocol for Internationalized Domain Names (IDNs) was completed and deployed. During that time, a number of issues have arisen, including the need to update the system to deal with newer versions of Unicode. Some of these issues require tuning of the existing protocols and the tables on which they depend. This document provides an overview of a revised system and provides explanatory material for its components. Status of This Memo This document is not an Internet Standards Track specification; it is published for informational purposes. This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Not all documents approved by the IESG are a candidate for any level of Internet Standard; see Section 2 of RFC 5741. Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc5894.
Copyright Notice Copyright (c) 2010 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.1. Context and Overview . . . . . . . . . . . . . . . . . . . 4 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 5 1.2.1. DNS "Name" Terminology . . . . . . . . . . . . . . . . 5 1.2.2. New Terminology and Restrictions . . . . . . . . . . . 6 1.3. Objectives . . . . . . . . . . . . . . . . . . . . . . . . 6 1.4. Applicability and Function of IDNA . . . . . . . . . . . . 7 1.5. Comprehensibility of IDNA Mechanisms and Processing . . . 8 2. Processing in IDNA2008 . . . . . . . . . . . . . . . . . . . . 9 3. Permitted Characters: An Inclusion List . . . . . . . . . . . 9 3.1. A Tiered Model of Permitted Characters and Labels . . . . 10 3.1.1. PROTOCOL-VALID . . . . . . . . . . . . . . . . . . . . 10 3.1.2. CONTEXTUAL RULE REQUIRED . . . . . . . . . . . . . . . 11 184.108.40.206. Contextual Restrictions . . . . . . . . . . . . . 11 220.127.116.11. Rules and Their Application . . . . . . . . . . . 12 3.1.3. DISALLOWED . . . . . . . . . . . . . . . . . . . . . . 12 3.1.4. UNASSIGNED . . . . . . . . . . . . . . . . . . . . . . 13 3.2. Registration Policy . . . . . . . . . . . . . . . . . . . 14
3.3. Layered Restrictions: Tables, Context, Registration, and Applications . . . . . . . . . . . . . . . . . . . . . . . 15 4. Application-Related Issues . . . . . . . . . . . . . . . . . . 15 4.1. Display and Network Order . . . . . . . . . . . . . . . . 15 4.2. Entry and Display in Applications . . . . . . . . . . . . 16 4.3. Linguistic Expectations: Ligatures, Digraphs, and Alternate Character Forms . . . . . . . . . . . . . . . . 19 4.4. Case Mapping and Related Issues . . . . . . . . . . . . . 20 4.5. Right-to-Left Text . . . . . . . . . . . . . . . . . . . . 21 5. IDNs and the Robustness Principle . . . . . . . . . . . . . . 22 6. Front-end and User Interface Processing for Lookup . . . . . . 22 7. Migration from IDNA2003 and Unicode Version Synchronization . 25 7.1. Design Criteria . . . . . . . . . . . . . . . . . . . . . 25 7.1.1. Summary and Discussion of IDNA Validity Criteria . . . 25 7.1.2. Labels in Registration . . . . . . . . . . . . . . . . 26 7.1.3. Labels in Lookup . . . . . . . . . . . . . . . . . . . 27 7.2. Changes in Character Interpretations . . . . . . . . . . . 28 7.2.1. Character Changes: Eszett and Final Sigma . . . . . . 28 7.2.2. Character Changes: Zero Width Joiner and Zero Width Non-Joiner . . . . . . . . . . . . . . . . . . . 29 7.2.3. Character Changes and the Need for Transition . . . . 29 7.2.4. Transition Strategies . . . . . . . . . . . . . . . . 30 7.3. Elimination of Character Mapping . . . . . . . . . . . . . 31 7.4. The Question of Prefix Changes . . . . . . . . . . . . . . 31 7.4.1. Conditions Requiring a Prefix Change . . . . . . . . . 31 7.4.2. Conditions Not Requiring a Prefix Change . . . . . . . 32 7.4.3. Implications of Prefix Changes . . . . . . . . . . . . 32 7.5. Stringprep Changes and Compatibility . . . . . . . . . . . 33 7.6. The Symbol Question . . . . . . . . . . . . . . . . . . . 33 7.7. Migration between Unicode Versions: Unassigned Code Points . . . . . . . . . . . . . . . . . . . . . . . . . . 35 7.8. Other Compatibility Issues . . . . . . . . . . . . . . . . 36 8. Name Server Considerations . . . . . . . . . . . . . . . . . . 37 8.1. Processing Non-ASCII Strings . . . . . . . . . . . . . . . 37 8.2. Root and Other DNS Server Considerations . . . . . . . . . 37 9. Internationalization Considerations . . . . . . . . . . . . . 38 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 38 10.1. IDNA Character Registry . . . . . . . . . . . . . . . . . 38 10.2. IDNA Context Registry . . . . . . . . . . . . . . . . . . 39 10.3. IANA Repository of IDN Practices of TLDs . . . . . . . . . 39 11. Security Considerations . . . . . . . . . . . . . . . . . . . 39 11.1. General Security Issues with IDNA . . . . . . . . . . . . 39 12. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 39 13. Contributors . . . . . . . . . . . . . . . . . . . . . . . . . 40 14. References . . . . . . . . . . . . . . . . . . . . . . . . . . 40 14.1. Normative References . . . . . . . . . . . . . . . . . . . 40 14.2. Informative References . . . . . . . . . . . . . . . . . . 41
1. Introduction 1.1. Context and Overview Internationalized Domain Names in Applications (IDNA) is a collection of standards that allow client applications to convert some mnemonic strings expressed in Unicode to an ASCII-compatible encoding form ("ACE") that is a valid DNS label containing only LDH syntax (see the Definitions document [RFC5890]). The specific form of ACE label used by IDNA is called an "A-label". A client can look up an exact A-label in the existing DNS, so A-labels do not require any extensions to DNS, upgrades of DNS servers, or updates to low-level client libraries. An A-label is recognizable from the prefix "xn--" before the characters produced by the Punycode algorithm [RFC3492]; thus, a user application can identify an A-label and convert it into Unicode (or some local coded character set) for display. On the registry side, IDNA allows a registry to offer Internationalized Domain Names (IDNs) for registration as A-labels. A registry may offer any subset of valid IDNs, and may apply any restrictions or bundling (grouping of similar labels together in one registration) appropriate for the context of that registry. Registration of labels is sometimes discussed separately from lookup, and it is subject to a few specific requirements that do not apply to lookup. DNS clients and registries are subject to some differences in requirements for handling IDNs. In particular, registries are urged to register only exact, valid A-labels, while clients might do some mapping to get from otherwise-invalid user input to a valid A-label. The first version of IDNA was published in 2003 and is referred to here as IDNA2003 to contrast it with the current version, which is known as IDNA2008 (after the year in which IETF work started on it). IDNA2003 consists of four documents: the IDNA base specification [RFC3490], Nameprep [RFC3491], Punycode [RFC3492], and Stringprep [RFC3454]. The current set of documents, IDNA2008, is not dependent on any of the IDNA2003 specifications other than the one for Punycode encoding. References to "IDNA2008", "these specifications", or "these documents" are to the entire IDNA2008 set listed in a separate Definitions document [RFC5890]. The characters that are valid in A-labels are identified from rules listed in the Tables document [RFC5892], but validity can be derived from the Unicode properties of those characters with a very few exceptions. Traditionally, DNS labels are matched case-insensitively (as described in the DNS specifications [RFC1034][RFC1035]). That convention was preserved in IDNA2003 by a case-folding operation that
generally maps capital letters into lowercase ones. However, if case rules are enforced from one language, another language sometimes loses the ability to treat two characters separately. Case- insensitivity is treated slightly differently in IDNA2008. IDNA2003 used Unicode version 3.2 only. In order to keep up with new characters added in new versions of Unicode, IDNA2008 decouples its rules from any particular version of Unicode. Instead, the attributes of new characters in Unicode, supplemented by a small number of exception cases, determine how and whether the characters can be used in IDNA labels. This document provides informational context for IDNA2008, including terminology, background, and policy discussions. It contains no normative material; specifications for conformance to the IDNA2008 protocols appears entirely in the other documents in the series. 1.2. Terminology Terminology for IDNA2008 appears in the Definitions document [RFC5890]. That document also contains a road map to the IDNA2008 document collection. No attempt should be made to understand this document without the definitions and concepts that appear there. 1.2.1. DNS "Name" Terminology In the context of IDNs, the DNS term "name" has introduced some confusion as people speak of DNS labels in terms of the words or phrases of various natural languages. Historically, many of the "names" in the DNS have been mnemonics to identify some particular concept, object, or organization. They are typically rooted in some language because most people think in language-based ways. But, because they are mnemonics, they need not obey the orthographic conventions of any language: it is not a requirement that it be possible for them to be "words". This distinction is important because the reasonable goal of an IDN effort is not to be able to write the great Klingon (or language of one's choice) novel in DNS labels but to be able to form a usefully broad range of mnemonics in ways that are as natural as possible in a very broad range of scripts.
1.2.2. New Terminology and Restrictions IDNA2008 introduces new terminology. Precise definitions are provided in the Definitions document for the terms U-label, A-Label, LDH label (to which all valid pre-IDNA hostnames conformed), Reserved LDH label (R-LDH label), XN-label, Fake A-label, and Non-Reserved LDH label (NR-LDH label). In addition, the term "putative label" has been adopted to refer to a label that may appear to meet certain definitional constraints but has not yet been sufficiently tested for validity. These definitions are also illustrated in Figure 1 of the Definitions document. R-LDH labels contain "--" in the third and fourth character positions from the beginning of the label. In IDNA-aware applications, only a subset of these reserved labels is permitted to be used, namely the A-label subset. A-labels are a subset of the R-LDH labels that begin with the case-insensitive string "xn--". Labels that bear this prefix but that are not otherwise valid fall into the "Fake A-label" category. The Non-Reserved labels (NR-LDH labels) are implicitly valid since they do not bear any resemblance to the labels specified by IDNA. The creation of the Reserved-LDH category is required for three reasons: o to prevent confusion with pre-IDNA coding forms; o to permit future extensions that would require changing the prefix, no matter how unlikely those might be (see Section 7.4); and o to reduce the opportunities for attacks via the Punycode encoding algorithm itself. As with other documents in the IDNA2008 set, this document uses the term "registry" to describe any zone in the DNS. That term, and the terms "zone" or "zone administration", are interchangeable. 1.3. Objectives These are the main objectives in revising IDNA. o Use a more recent version of Unicode and allow IDNA to be independent of Unicode versions, so that IDNA2008 need not be updated for implementations to adopt code points from new Unicode versions.
o Fix a very small number of code point categorizations that have turned out to cause problems in the communities that use those code points. o Reduce the dependency on mapping, in favor of valid A-labels. This will result in pre-mapped forms that are not valid IDNA labels appearing less often in various contexts. o Fix some details in the bidirectional code point handling algorithms. 1.4. Applicability and Function of IDNA The IDNA specification solves the problem of extending the repertoire of characters that can be used in domain names to include a large subset of the Unicode repertoire. IDNA does not extend DNS. Instead, the applications (and, by implication, the users) continue to see an exact-match lookup service. Either there is a single name that matches exactly (subject to the base DNS requirement of case-insensitive ASCII matching) or there is no match. This model has served the existing applications well, but it requires, with or without internationalized domain names, that users know the exact spelling of the domain names that are to be typed into applications such as web browsers and mail user agents. The introduction of the larger repertoire of characters potentially makes the set of misspellings larger, especially given that in some cases the same appearance, for example on a business card, might visually match several Unicode code points or several sequences of code points. The IDNA standard does not require any applications to conform to it, nor does it retroactively change those applications. An application can elect to use IDNA in order to support IDNs while maintaining interoperability with existing infrastructure. For applications that want to use non-ASCII characters in public DNS domain names, IDNA is the only option that is defined at the time this specification is published. Adding IDNA support to an existing application entails changes to the application only, and leaves room for flexibility in front-end processing and more specifically in the user interface (see Section 6). A great deal of the discussion of IDN solutions has focused on transition issues and how IDNs will work in a world where not all of the components have been updated. Proposals that were not chosen by the original IDN Working Group would have depended on updating user applications, DNS resolvers, and DNS servers in order for a user to apply an internationalized domain name in any form or coding
acceptable under that method. While processing must be performed prior to or after access to the DNS, IDNA requires no changes to the DNS protocol, any DNS servers, or the resolvers on users' computers. IDNA allows the graceful introduction of IDNs not only by avoiding upgrades to existing infrastructure (such as DNS servers and mail transport agents), but also by allowing some limited use of IDNs in applications by using the ASCII-encoded representation of the labels containing non-ASCII characters. While such names are user- unfriendly to read and type, and hence not optimal for user input, they can be used as a last resort to allow rudimentary IDN usage. For example, they might be the best choice for display if it were known that relevant fonts were not available on the user's computer. In order to allow user-friendly input and output of the IDNs and acceptance of some characters as equivalent to those to be processed according to the protocol, the applications need to be modified to conform to this specification. This version of IDNA uses the Unicode character repertoire for continuity with the original version of IDNA. 1.5. Comprehensibility of IDNA Mechanisms and Processing One goal of IDNA2008, which is aided by the main goal of reducing the dependency on mapping, is to improve the general understanding of how IDNA works and what characters are permitted and what happens to them. Comprehensibility and predictability to users and registrants are important design goals for this effort. End-user applications have an important role to play in increasing this comprehensibility. Any system that tries to handle international characters encounters some common problems. For example, a User Interface (UI) cannot display a character if no font containing that character is available. In some cases, internationalization enables effective localization while maintaining some global uniformity but losing some universality. It is difficult to even make suggestions as to how end-user applications should cope when characters and fonts are not available. Because display functions are rarely controlled by the types of applications that would call upon IDNA, such suggestions will rarely be very effective. Conversion between local character sets and normalized Unicode, if needed, is part of this set of user interface issues. Those conversions introduce complexity in a system that does not use Unicode as its primary (or only) internal character coding system. If a label is converted to a local character set that does not have
all the needed characters, or that uses different character-coding principles, the user interface program may have to add special logic to avoid or reduce loss of information. The major difficulty may lie in accurately identifying the incoming character set and applying the correct conversion routine. Even more difficult, the local character coding system could be based on conceptually different assumptions than those used by Unicode (e.g., choice of font encodings used for publications in some Indic scripts). Those differences may not easily yield unambiguous conversions or interpretations even if each coding system is internally consistent and adequate to represent the local language and script. IDNA2008 shifts responsibility for character mapping and other adjustments from the protocol (where it was located in IDNA2003) to pre-processing before invoking IDNA itself. The intent is that this change will lead to greater usage of fully-valid A-Labels or U-labels in display, transit, and storage, which should aid comprehensibility and predictability. A careful look at pre-processing raises issues about what that pre-processing should do and at what point pre-processing becomes harmful; how universally consistent pre-processing algorithms can be; and how to be compatible with labels prepared in an IDNA2003 context. Those issues are discussed in Section 6 and in the Mapping document [IDNA2008-Mapping]. 2. Processing in IDNA2008 IDNA2008 separates Domain Name Registration and Lookup in the protocol specification (RFC 5891, Sections 4 and 5 [RFC5891]). Although most steps in the two processes are similar, the separation reflects current practice in which per-registry (DNS zone) restrictions and special processing are applied at registration time but not during lookup. Another significant benefit is that separation facilitates incremental addition of permitted character groups to avoid freezing on one particular version of Unicode. The actual registration and lookup protocols for IDNA2008 are specified in the Protocol document. 3. Permitted Characters: An Inclusion List IDNA2008 adopts the inclusion model. A code point is assumed to be invalid for IDN use unless it is included as part of a Unicode property-based rule or, in rare cases, included individually by an exception. When an implementation moves to a new version of Unicode, the rules may indicate new valid code points.
This section provides an overview of the model used to establish the algorithm and character lists of the Tables document [RFC5892] and describes the names and applicability of the categories used there. Note that the inclusion of a character in the PROTOCOL-VALID category group (Section 3.1.1) does not imply that it can be used indiscriminately; some characters are associated with contextual rules that must be applied as well. The information given in this section is provided to make the rules, tables, and protocol easier to understand. The normative generating rules that correspond to this informal discussion appear in the Tables document, and the rules that actually determine what labels can be registered or looked up are in the Protocol document. 3.1. A Tiered Model of Permitted Characters and Labels Moving to an inclusion model involves a new specification for the list of characters that are permitted in IDNs. In IDNA2003, character validity is independent of context and fixed forever (or until the standard is replaced). However, globally context- independent rules have proved to be impractical because some characters, especially those that are called "Join_Controls" in Unicode, are needed to make reasonable use of some scripts but have no visible effect in others. IDNA2003 prohibited those types of characters entirely by discarding them. We now have a consensus that under some conditions, these "joiner" characters are legitimately needed to allow useful mnemonics for some languages and scripts. In general, context-dependent rules help deal with characters (generally characters that would otherwise be prohibited entirely) that are used differently or perceived differently across different scripts, and allow the standard to be applied more appropriately in cases where a string is not universally handled the same way. IDNA2008 divides all possible Unicode code points into four categories: PROTOCOL-VALID, CONTEXTUAL RULE REQUIRED, DISALLOWED, and UNASSIGNED. 3.1.1. PROTOCOL-VALID Characters identified as PROTOCOL-VALID (often abbreviated PVALID) are permitted in IDNs. Their use may be restricted by rules about the context in which they appear or by other rules that apply to the entire label in which they are to be embedded. For example, any label that contains a character in this category that has a "right-to-left" property must be used in context with the Bidi rules [RFC5893]. The term PROTOCOL-VALID is used to stress the fact that the presence of a character in this category does not imply that a given registry need accept registrations containing any of the
characters in the category. Registries are still expected to apply judgment about labels they will accept and to maintain rules consistent with those judgments (see the Protocol document [RFC5891] and Section 3.3). Characters that are placed in the PROTOCOL-VALID category are expected to never be removed from it or reclassified. While theoretically characters could be removed from Unicode, such removal would be inconsistent with the Unicode stability principles (see UTR 39: Unicode Security Mechanisms [Unicode52], Appendix F) and hence should never occur. 3.1.2. CONTEXTUAL RULE REQUIRED Some characters may be unsuitable for general use in IDNs but necessary for the plausible support of some scripts. The two most commonly cited examples are the ZERO WIDTH JOINER and ZERO WIDTH NON-JOINER characters (ZWJ, U+200D and ZWNJ, U+200C), but other characters may require special treatment because they would otherwise be DISALLOWED (typically because Unicode considers them punctuation or special symbols) but need to be permitted in limited contexts. Other characters are given this special treatment because they pose exceptional danger of being used to produce misleading labels or to cause unacceptable ambiguity in label matching and interpretation. 18.104.22.168. Contextual Restrictions Characters with contextual restrictions are identified as CONTEXTUAL RULE REQUIRED and are associated with a rule. The rule defines whether the character is valid in a particular string, and also whether the rule itself is to be applied on lookup as well as registration. A distinction is made between characters that indicate or prohibit joining and ones similar to them (known as CONTEXT-JOINER or CONTEXTJ) and other characters requiring contextual treatment (CONTEXT-OTHER or CONTEXTO). Only the former require full testing at lookup time. It is important to note that these contextual rules cannot prevent all uses of the relevant characters that might be confusing or problematic. What they are expected to do is to confine applicability of the characters to scripts (and narrower contexts) where zone administrators are knowledgeable enough about the use of those characters to be prepared to deal with them appropriately.
For example, a registry dealing with an Indic script that requires ZWJ and/or ZWNJ as part of the writing system is expected to understand where the characters have visible effect and where they do not and to make registration rules accordingly. By contrast, a registry dealing primarily with Latin or Cyrillic script might not be actively aware that the characters exist, much less about the consequences of embedding them in labels drawn from those scripts and therefore should avoid accepting registrations containing those characters, at least in labels using characters from the Latin or Cyrillic scripts. 22.214.171.124. Rules and Their Application Rules have descriptions such as "Must follow a character from Script XYZ", "Must occur only if the entire label is in Script ABC", or "Must occur only if the previous and subsequent characters have the DFG property". The actual rules may be DEFINED or NULL. If present, they may have values of "True" (character may be used in any position in any label), "False" (character may not be used in any label), or may be a set of procedural rules that specify the context in which the character is permitted. Because it is easier to identify these characters than to know that they are actually needed in IDNs or how to establish exactly the right rules for each one, a rule may have a null value in a given version of the tables. Characters associated with null rules are not permitted to appear in putative labels for either registration or lookup. Of course, a later version of the tables might contain a non-null rule. The actual rules and their descriptions are in Sections 2 and 3 of the Tables document [RFC5892]. That document also specifies the creation of a registry for future rules. 3.1.3. DISALLOWED Some characters are inappropriate for use in IDNs and are thus excluded for both registration and lookup (i.e., IDNA-conforming applications performing name lookup should verify that these characters are absent; if they are present, the label strings should be rejected rather than converted to A-labels and looked up. Some of these characters are problematic for use in IDNs (such as the FRACTION SLASH character, U+2044), while some of them (such as the various HEART symbols, e.g., U+2665, U+2661, and U+2765, see Section 7.6) simply fall outside the conventions for typical identifiers (basically letters and numbers).
Of course, this category would include code points that had been removed entirely from Unicode should such removals ever occur. Characters that are placed in the DISALLOWED category are expected to never be removed from it or reclassified. If a character is classified as DISALLOWED in error and the error is sufficiently problematic, the only recourse would be either to introduce a new code point into Unicode and classify it as PROTOCOL-VALID or for the IETF to accept the considerable costs of an incompatible change and replace the relevant RFC with one containing appropriate exceptions. There is provision for exception cases but, in general, characters are placed into DISALLOWED if they fall into one or more of the following groups: o The character is a compatibility equivalent for another character. In slightly more precise Unicode terms, application of Normalization Form KC (NFKC) to the character yields some other character. o The character is an uppercase form or some other form that is mapped to another character by Unicode case folding. o The character is a symbol or punctuation form or, more generally, something that is not a letter, digit, or a mark that is used to form a letter or digit. 3.1.4. UNASSIGNED For convenience in processing and table-building, code points that do not have assigned values in a given version of Unicode are treated as belonging to a special UNASSIGNED category. Such code points are prohibited in labels to be registered or looked up. The category differs from DISALLOWED in that code points are moved out of it by the simple expedient of being assigned in a later version of Unicode (at which point, they are classified into one of the other categories as appropriate). The rationale for restricting the processing of UNASSIGNED characters is simply that the properties of such code points cannot be completely known until actual characters are assigned to them. For example, assume that an UNASSIGNED code point were included in a label to be looked up. Assume that the code point was later assigned to a character that required some set of contextual rules. With that combination, un-updated instances of IDNA-aware software might permit lookup of labels containing the previously unassigned characters while updated versions of the software might restrict use of the same
label in lookup, depending on the contextual rules. It should be clear that under no circumstance should an UNASSIGNED character be permitted in a label to be registered as part of a domain name. 3.2. Registration Policy While these recommendations cannot and should not define registry policies, registries should develop and apply additional restrictions as needed to reduce confusion and other problems. For example, it is generally believed that labels containing characters from more than one script are a bad practice although there may be some important exceptions to that principle. Some registries may choose to restrict registrations to characters drawn from a very small number of scripts. For many scripts, the use of variant techniques such as those as described in the JET specification for the CJK script [RFC3743] and its generalization [RFC4290], and illustrated for Chinese by the tables provided by the Chinese Domain Name Consortium [RFC4713] may be helpful in reducing problems that might be perceived by users. In general, users will benefit if registries only permit characters from scripts that are well-understood by the registry or its advisers. If a registry decides to reduce opportunities for confusion by constructing policies that disallow characters used in historic writing systems or characters whose use is restricted to specialized, highly technical contexts, some relevant information may be found in Section 2.4 (Specific Character Adjustments) of Unicode Identifier and Pattern Syntax [Unicode-UAX31], especially Table 4 (Candidate Characters for Exclusion from Identifiers), and Section 3.1 (General Security Profile for Identifiers) in Unicode Security Mechanisms [Unicode-UTS39]. The requirement (in Section 4.1 of the Protocol document [RFC5891]) that registration procedures use only U-labels and/or A-labels is intended to ensure that registrants are fully aware of exactly what is being registered as well as encouraging use of those canonical forms. That provision should not be interpreted as requiring that registrants need to provide characters in a particular code sequence. Registrant input conventions and management are part of registrant- registrar interactions and relationships between registries and registrars and are outside the scope of these standards. It is worth stressing that these principles of policy development and application apply at all levels of the DNS, not only, e.g., top level domain (TLD) or second level domain (SLD) registrations. Even a trivial, "anything is permitted that is valid under the protocol" policy is helpful in that it helps users and application developers know what to expect.
3.3. Layered Restrictions: Tables, Context, Registration, and Applications The character rules in IDNA2008 are based on the realization that there is no single magic bullet for any of the security, confusability, or other issues associated with IDNs. Instead, the specifications define a variety of approaches. The character tables are the first mechanism, protocol rules about how those characters are applied or restricted in context are the second, and those two in combination constitute the limits of what can be done in the protocol. As discussed in the previous section (Section 3.2), registries are expected to restrict what they permit to be registered, devising and using rules that are designed to optimize the balance between confusion and risk on the one hand and maximum expressiveness in mnemonics on the other. In addition, there is an important role for user interface programs in warning against label forms that appear problematic given their knowledge of local contexts and conventions. Of course, no approach based on naming or identifiers alone can protect against all threats. 4. Application-Related Issues 4.1. Display and Network Order Domain names are always transmitted in network order (the order in which the code points are sent in protocols), but they may have a different display order (the order in which the code points are displayed on a screen or paper). When a domain name contains characters that are normally written right to left, display order may be affected although network order is not. It gets even more complicated if left-to-right and right-to-left labels are adjacent to each other within a domain name. The decision about the display order is ultimately under the control of user agents -- including Web browsers, mail clients, hosted Web applications and many more -- which may be highly localized. Should a domain name abc.def, in which both labels are represented in scripts that are written right to left, be displayed as fed.cba or cba.fed? Applications that are in deployment today are already diverse, and one can find examples of either choice. The picture changes once again when an IDN appears in an Internationalized Resource Identifier (IRI) [RFC3987]. An IRI or internationalized email address contains elements other than the domain name. For example, IRIs contain protocol identifiers and field delimiter syntax such as "http://" or "mailto:" while email addresses contain the "@" to separate local parts from domain names.
An IRI in network order begins with "http://" followed by domain labels in network order, thus "http://abc.def". User interface programs are not required to display and allow input of IRIs directly but often do so. Implementers have to choose whether the overall direction of these strings will always be left to right (or right to left) for an IRI or email address. The natural order for a user typing a domain name on a right-to-left system is fed.cba. Should the right-to-left (RTL) user interface reverse the entire domain name each time a domain name is typed? Does this change if the user types "http://" right before typing a domain name, thus implying that the user is beginning at the beginning of the network-order IRI? Experience in the 1980s and 1990s with mixing systems in which domain name labels were read in network order (left to right) and those in which those labels were read right to left would predict a great deal of confusion. If each implementation of each application makes its own decisions on these issues, users will develop heuristics that will sometimes fail when switching applications. However, while some display order conventions, voluntarily adopted, would be desirable to reduce confusion, such suggestions are beyond the scope of these specifications. 4.2. Entry and Display in Applications Applications can accept and display domain names using any character set or character coding system. The IDNA protocol does not necessarily affect the interface between users and applications. An IDNA-aware application can accept and display internationalized domain names in two formats: as the internationalized character set(s) supported by the application (i.e., an appropriate local representation of a U-label) and as an A-label. Applications may allow the display of A-labels, but are encouraged not to do so except as an interface for special purposes, possibly for debugging, or to cope with display limitations. In general, they should allow, but not encourage, user input of A-labels. A-labels are opaque and ugly, and malicious variations on them are not easily detected by users. Where possible, they should thus only be exposed when they are absolutely needed. Because IDN labels can be rendered either as A-labels or U-labels, the application may reasonably have an option for the user to select the preferred method of display. Rendering the U-label should normally be the default. Domain names are often stored and transported in many places. For example, they are part of documents such as mail messages and web pages. They are transported in many parts of many protocols, such as both the control commands of SMTP and associated message body parts,
and in the headers and the body content in HTTP. It is important to remember that domain names appear both in domain name slots and in the content that is passed over protocols, and it would be helpful if protocols explicitly define what their domain name slots are. In protocols and document formats that define how to handle specification or negotiation of charsets, labels can be encoded in any charset allowed by the protocol or document format. If a protocol or document format only allows one charset, the labels must be given in that charset. Of course, not all charsets can properly represent all labels. If a U-label cannot be displayed in its entirety, the only choice (without loss of information) may be to display the A-label. Where a protocol or document format allows IDNs, labels should be in whatever character encoding and escape mechanism the protocol or document format uses in the local environment. This provision is intended to prevent situations in which, e.g., UTF-8 domain names appear embedded in text that is otherwise in some other character coding. All protocols that use domain name slots (see Section 126.96.36.199 in the Definitions document [RFC5890]) already have the capacity for handling domain names in the ASCII charset. Thus, A-labels can inherently be handled by those protocols. IDNA2008 does not specify required mappings between one character or code point and others. An extended discussion of mapping issues appears in Section 6 and specific recommendations appear in the Mapping document [IDNA2008-Mapping]. In general, IDNA2008 prohibits characters that would be mapped to others by normalization or other rules. As examples, while mathematical characters based on Latin ones are accepted as input to IDNA2003, they are prohibited in IDNA2008. Similarly, uppercase characters, double-width characters, and other variations are prohibited as IDNA input although mapping them as needed in user interfaces is strongly encouraged. Since the rules in the Tables document [RFC5892] have the effect that only strings that are not transformed by NFKC are valid, if an application chooses to perform NFKC normalization before lookup, that operation is safe since this will never make the application unable to look up any valid string. However, as discussed above, the application cannot guarantee that any other application will perform that mapping, so it should be used only with caution and for informed users.
In many cases, these prohibitions should have no effect on what the user can type as input to the lookup process. It is perfectly reasonable for systems that support user interfaces to perform some character mapping that is appropriate to the local environment. This would normally be done prior to actual invocation of IDNA. At least conceptually, the mapping would be part of the Unicode conversions discussed above and in the Protocol document [RFC5891]. However, those changes will be local ones only -- local to environments in which users will clearly understand that the character forms are equivalent. For use in interchanges among systems, it appears to be much more important that U-labels and A-labels can be mapped back and forth without loss of information. One specific, and very important, instance of this strategy arises with case folding. In the ASCII-only DNS, names are looked up and matched in a case-independent way, but no actual case folding occurs. Names can be placed in the DNS in either uppercase or lowercase form (or any mixture of them) and that form is preserved, returned in queries, and so on. IDNA2003 approximated that behavior for non-ASCII strings by performing case folding at registration time (resulting in only lowercase IDNs in the DNS) and when names were looked up. As suggested earlier in this section, it appears to be desirable to do as little character mapping as possible as long as Unicode works correctly (e.g., Normalization Form C (NFC) mapping to resolve different codings for the same character is still necessary although the specifications require that it be performed prior to invoking the protocol) in order to make the mapping between A-labels and U-labels idempotent. Case mapping is not an exception to this principle. If only lowercase characters can be registered in the DNS (i.e., be present in a U-label), then IDNA2008 should prohibit uppercase characters as input even though user interfaces to applications should probably map those characters. Some other considerations reinforce this conclusion. For example, in ASCII case mapping for individual characters, uppercase(character) is always equal to uppercase(lowercase(character)). That may not be true with IDNs. In some scripts that use case distinctions, there are a few characters that do not have counterparts in one case or the other. The relationship between uppercase and lowercase may even be language- dependent, with different languages (or even the same language in different areas) expecting different mappings. User interface programs can meet the expectations of users who are accustomed to the case-insensitive DNS environment by performing case folding prior to IDNA processing, but the IDNA procedures themselves should neither require such mapping nor expect them when they are not natural to the localized environment.
4.3. Linguistic Expectations: Ligatures, Digraphs, and Alternate Character Forms Users have expectations about character matching or equivalence that are based on their own languages and the orthography of those languages. These expectations may not always be met in a global system, especially if multiple languages are written using the same script but using different conventions. Some examples: o A Norwegian user might expect a label with the ae-ligature to be treated as the same label as one using the Swedish spelling with a-diaeresis even though applying that mapping to English would be astonishing to users. o A German user might expect a label with an o-umlaut and a label that had "oe" substituted, but was otherwise the same, to be treated as equivalent even though that substitution would be a clear error in Swedish. o A Chinese user might expect automatic matching of Simplified and Traditional Chinese characters, but applying that matching for Korean or Japanese text would create considerable confusion. o An English user might expect "theater" and "theatre" to match. A number of languages use alphabetic scripts in which single phonemes are written using two characters, termed a "digraph", for example, the "ph" in "pharmacy" and "telephone". (Such characters can also appear consecutively without forming a digraph, as in "tophat".) Certain digraphs may be indicated typographically by setting the two characters closer together than they would be if used consecutively to represent different phonemes. Some digraphs are fully joined as ligatures. For example, the word "encyclopaedia" is sometimes set with a U+00E6 LATIN SMALL LIGATURE AE. When ligature and digraph forms have the same interpretation across all languages that use a given script, application of Unicode normalization generally resolves the differences and causes them to match. When they have different interpretations, matching must utilize other methods, presumably chosen at the registry level, or users must be educated to understand that matching will not occur. The nature of the problem can be illustrated by many words in the Norwegian language, where the "ae" ligature is the 27th letter of a 29-letter extended Latin alphabet. It is equivalent to the 28th letter of the Swedish alphabet (also containing 29 letters), U+00E4 LATIN SMALL LETTER A WITH DIAERESIS, for which an "ae" cannot be substituted according to current orthographic standards. That character (U+00E4) is also part of the German alphabet where, unlike
in the Nordic languages, the two-character sequence "ae" is usually treated as a fully acceptable alternate orthography for the "umlauted a" character. The inverse is however not true, and those two characters cannot necessarily be combined into an "umlauted a". This also applies to another German character, the "umlauted o" (U+00F6 LATIN SMALL LETTER O WITH DIAERESIS) which, for example, cannot be used for writing the name of the author "Goethe". It is also a letter in the Swedish alphabet where, like the "a with diaeresis", it cannot be correctly represented as "oe" and in the Norwegian alphabet, where it is represented, not as "o with diaeresis", but as "slashed o", U+00F8. Some of the ligatures that have explicit code points in Unicode were given special handling in IDNA2003 and now pose additional problems in transition. See Section 7.2. Additional cases with alphabets written right to left are described in Section 4.5. Matching and comparison algorithm selection often requires information about the language being used, context, or both -- information that is not available to IDNA or the DNS. Consequently, IDNA2008 makes no attempt to treat combined characters in any special way. A registry that is aware of the language context in which labels are to be registered, and where that language sometimes (or always) treats the two-character sequences as equivalent to the combined form, should give serious consideration to applying a "variant" model [RFC3743][RFC4290] or to prohibiting registration of one of the forms entirely, to reduce the opportunities for user confusion and fraud that would result from the related strings being registered to different parties. 4.4. Case Mapping and Related Issues In the DNS, ASCII letters are stored with their case preserved. Matching during the query process is case-independent, but none of the information that might be represented by choices of case has been lost. That model has been accidentally helpful because, as people have created DNS labels by catenating words (or parts of words) to form labels, case has often been used to distinguish among components and make the labels more memorable. Since DNS servers do not get involved in parsing IDNs, they cannot do case-independent matching. Thus, keeping the cases separate in lookup or registration, and doing matching at the server, is not feasible with IDNA or any similar approach. Matching of characters that are considered to differ only by case must be done, if desired, by programs invoking IDNA lookup even though it wasn't done by ASCII-
only DNS clients. That situation was recognized in IDNA2003 and nothing in IDNA2008 fundamentally changes it or could do so. In IDNA2003, all characters are case folded and mapped by clients in a standardized step. Even in scripts that generally support case distinctions, some characters do not have uppercase forms. For example, the Unicode case-folding operation maps Greek Final Form Sigma (U+03C2) to the medial form (U+03C3) and maps Eszett (German Sharp S, U+00DF) to "ss". Neither of these mappings is reversible because the uppercase of U+03C3 is the uppercase Sigma (U+03A3) and "ss" is an ASCII string. IDNA2008 permits, at the risk of some incompatibility, slightly more flexibility in this area by avoiding case folding and treating these characters as themselves. Approaches to handling one- way mappings are discussed in Section 7.2. Because IDNA2003 maps Final Sigma and Eszett to other characters, and the reverse mapping is never possible, neither Final Sigma nor Eszett can be represented in the ACE form of IDNA2003 IDN nor in the native character (U-label) form derived from it. With IDNA2008, both characters can be used in an IDN and so the A-label used for lookup for any U-label containing those characters is now different. See Section 7.1 for a discussion of what kinds of changes might require the IDNA prefix to change; after extended discussions, the IDNABIS Working Group came to consensus that the change for these characters did not justify a prefix change. 4.5. Right-to-Left Text In order to be sure that the directionality of right-to-left text is unambiguous, IDNA2003 required that any label in which right-to-left characters appear both starts and ends with them and that it does not include any characters with strong left-to-right properties (that excludes other alphabetic characters but permits European digits). Any other string that contains a right-to-left character and does not meet those requirements is rejected. This is one of the few places where the IDNA algorithms (both in IDNA2003 and in IDNA2008) examine an entire label, not just individual characters. The algorithmic model used in IDNA2003 rejects the label when the final character in a right-to-left string requires a combining mark in order to be correctly represented. That prohibition is not acceptable for writing systems for languages written with consonantal alphabets to which diacritical vocalic systems are applied, and for languages with orthographies derived from them where the combining marks may have different functionality. In both cases, the combining marks can be essential components of the orthography. Examples of this are Yiddish, written with an extended
Hebrew script, and Dhivehi (the official language of Maldives), which is written in the Thaana script (which is, in turn, derived from the Arabic script). IDNA2008 removes the restriction on final combining characters with a new set of rules for right-to-left scripts and their characters. Those new rules are specified in the Bidi document [RFC5893].