RFC 7700
Preparation, Enforcement, and Comparison of Internationalized Strings Representing Nicknames
Preparation, Enforcement, and Comparison of Internationalized Strings Representing Nicknames π
Okay bestie, RFC 7700 is here π It's an Internet Standards Track doc written by P. Saint-Andre of &yet, published in December 2015, with ISSN 2070-1721. It's from the IETF, and the header doesn't list any RFCs it obsoletes or updates, so there's no lineage drama here β¨
Abstract β¨
Okay so this doc is all about handling Unicode strings for the memorable, human-friendly names we give things. Think "nicknames," "display names," or "petnames" π¦ They can be for people, devices, accounts, websites, and basically anything else that needs a cute label.
Status of This Memo π
This is an Internet Standards Track document. It's a product of the Internet Engineering Task Force (IETF), so it represents the consensus of the IETF community π«Ά It got public review and was approved for publication by the Internet Engineering Steering Group (IESG). If you want more on Internet Standards, check out Section 2 of RFC 5741.
For the current status, any errata, and how to send feedback, go to http://www.rfc-editor.org/info/rfc7700.
Copyright Notice Β©
Copyright (c) 2015 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 read these carefully, because they spell out your rights and restrictions for this document. Code Components pulled out of this document have to include Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions, and they come without warranty, as described in the Simplified BSD License.
Table of Contents πΊοΈ
1. Introduction ....................................................2
1.1. Overview ...................................................2
1.2. Terminology ................................................3
2. Nickname Profile ................................................3
2.1. Rules ......................................................3
2.2. Preparation ................................................5
2.3. Enforcement ................................................5
2.4. Comparison .................................................5
3. Examples ........................................................5
4. Use in Application Protocols ....................................6
5. IANA Considerations .............................................7
6. Security Considerations .........................................8
6.1. Reuse of PRECIS ............................................8
6.2. Reuse of Unicode ...........................................8
6.3. Visually Similar Characters ................................8
7. References ......................................................8
7.1. Normative References .......................................8
7.2. Informative References .....................................9
Acknowledgements ..................................................11
Author's Address ..................................................11
1. Introduction πΈ
1.1. Overview
So lots of tech lets a person pick a memorable, human-friendly name for chatting, or set one for something else like a device, account, contact, or website π These names are called "nicknames" in chat rooms (for example), "display names" in Internet mail, or "petnames" (see [PETNAME-SYSTEMS]). This doc just calls them all "nicknames" for consistency π
Nicknames are super common in text chat rooms. Think Internet Relay Chat [RFC2811], plus multi-party chat built on the Extensible Messaging and Presence Protocol (XMPP) [RFC6120] [XEP-0045], the Message Session Relay Protocol (MSRP) [RFC4975] [RFC7701], and Centralized Conferencing (XCON) [RFC5239] [XCON-SYSTEM]. Newer chat tech also lets nicknames be internationalized, since they can use characters outside the ASCII range [RFC20], usually through the Unicode character set [Unicode] π Even though these nicknames are mostly for display, people sometimes use them in code too, like kicking users or avoiding nickname conflicts π
A similar thing happens when someone sets their own preferred display name or sets one for another user. Examples are the "display-name" construct in the Internet message format [RFC5322] and [XEP-0172] in XMPP β¨
Memorable names show up way beyond messaging too, like names for devices in a network visualization app, websites in browser bookmarks, accounts in a bank's list of payees, people in a contact list app, and so on π§
The rules in this doc can be applied in all of those contexts π
Last thing: to make memorable names actually work for typical users all over the world, this doc defines rules for preparing, enforcing, and comparing internationalized nicknames. It's giving global bestie energy π
1.2. Terminology
A bunch of the important terms here are defined in [RFC7564], [RFC6365], and [Unicode] π
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119]. Yes, those capitalized words are the official ones, so they're doing serious work π«‘
2. Nickname Profile π
2.1. Rules
Okay, these rules apply inside the Nickname profile of the PRECIS FreeformClass. Let's go one by one π¦
- Width Mapping Rule: There is no width-mapping rule. It's not needed, because width mapping happens as part of normalization using Normalization Form KC (NFKC), which is spelled out below β¨
- Additional Mapping Rule: This rule has the following sub-rules.
- Any instances of non-ASCII space MUST be mapped to ASCII space (
U+0020). A non-ASCII space is any Unicode code point with a general category of "Zs", except of course forU+0020itself πΈ - Any instances of the ASCII space character at the beginning or end of a nickname MUST be removed. For example,
"stpeter "gets mapped to"stpeter"π - Interior sequences of more than one ASCII space character MUST be mapped to a single ASCII space character. For example,
"St Peter"gets mapped to"St Peter"π
- Any instances of non-ASCII space MUST be mapped to ASCII space (
- Case Mapping Rule: Unicode Default Case Folding MUST be applied, as defined in the Unicode Standard [Unicode]. At the time of writing, the algorithm is in Chapter 3 of [Unicode7.0]. Apps that don't allow conflicting nicknames get a nice boost from this rule, since it stops nicknames that differ only by case (like
"stpeter"vs."StPeter") from showing up to a human user at the same time π - Normalization Rule: The string MUST be normalized using Unicode NFKC. NFKC is extra "aggressive" at finding matches. In Unicode terms, it does both canonical and compatibility decomposition before recomposing code points. That helps cut down on confusion by making more characters match. For example, U+2163 ROMAN NUMERAL FOUR would match the combination of U+0049 LATIN CAPITAL LETTER I and U+0056 LATIN CAPITAL LETTER V π₯
- Directionality Rule: There is no directionality rule. The "Bidi Rule" (defined in [RFC5893]) and similar rules are unnecessary and don't apply to nicknames. It's totally fine for a nickname to look different in different layout systems, like a UI set up mostly for right-to-left scripts versus one set up for left-to-right scripts. The only requirement is that it stays consistent within any given layout system π
2.2. Preparation
An entity that prepares a string for later enforcement under this profile MUST make sure the string only has Unicode code points that conform to the FreeformClass string class defined in [RFC7564]. On top of that, the entity MUST make sure the string is encoded as UTF-8 [RFC3629] π
2.3. Enforcement
An entity that enforces this profile MUST prepare a string as described in Section 2.2, and it MUST also apply the following rules from Section 2.1, in this order π
- Additional Mapping Rule
- Normalization Rule
- Directionality Rule
After all of those rules have been enforced, the entity MUST make sure the nickname is not zero bytes in length. This check happens after the rules on purpose, so apps don't accidentally drop a nickname entirely. When internationalized characters are allowed, a non-empty sequence of characters can end up as a zero-length nickname after canonicalization π
2.4. Comparison
An entity that compares two strings under this profile MUST prepare each string as specified in Section 2.2, and it MUST apply the following rules from Section 2.1 in this order β¨
- Additional Mapping Rule
- Case Mapping Rule
- Normalization Rule
- Directionality Rule
The two strings are considered equivalent if they are an exact octet-for-octet match, which is also called "bit-string identity" π¦
3. Examples β¨
okay so bestie, this section is literally a parade of nicknames π each one gets run through the PRECIS rules, and you can see the output that gets used for comparison. (heads up: the < and > are just there to show where the nickname starts and stops. they are NOT part of the actual string π
)
Table 1: A Sample of Legal Nicknames
+---------------------------+-----------------------------------+
| # | Nickname | Output for Comparison |
+---------------------------+-----------------------------------+
| 1 | <Foo> | <foo> |
+---------------------------+-----------------------------------+
| 2 | <foo> | <foo> |
+---------------------------+-----------------------------------+
| 3 | <Foo Bar> | <foo bar> |
+---------------------------+-----------------------------------+
| 4 | <foo bar> | <foo bar> |
+---------------------------+-----------------------------------+
| 5 | <Σ> | GREEK SMALL LETTER SIGMA (U+03C3) |
+---------------------------+-----------------------------------+
| 6 | <σ> | GREEK SMALL LETTER SIGMA (U+03C3) |
+---------------------------+-----------------------------------+
| 7 | <ς> | GREEK SMALL LETTER SIGMA (U+03C3) |
+---------------------------+-----------------------------------+
| 8 | <♚> | BLACK CHESS KING (U+265A) |
+---------------------------+-----------------------------------+
| 9 | <Richard Ⅳ> | <richard iv> |
+---------------------------+-----------------------------------+
Regarding examples 5, 6, and 7: applying Unicode Default Case Folding to GREEK CAPITAL LETTER SIGMA (U+03A3) results in GREEK SMALL LETTER SIGMA (U+03C3), and the same is true of GREEK SMALL LETTER FINAL SIGMA (U+03C2) π§ therefore, the comparison operation defined in Section 2.4 would result in matching of the nicknames in examples 5, 6, and 7. no cap, these three are a whole sigma squad π₯
Regarding example 8: symbol characters such as BLACK CHESS KING (U+265A) are allowed by the PRECIS FreeformClass and thus can be used in nicknames. a chess king as your nickname?? iconic π
Regarding example 9: applying Unicode Default Case Folding to ROMAN NUMERAL FOUR (U+2163) results in SMALL ROMAN NUMERAL FOUR (U+2173), and applying NFKC to SMALL ROMAN NUMERAL FOUR (U+2173) results in LATIN SMALL LETTER I (U+0069) LATIN SMALL LETTER V (U+0086). the way Richard IV becomes richard iv ππ¦
4. Use in Application Protocols π
okay so this spec only handles the PRECIS-based rules for nickname strings πΈ it's on the application protocol (like MSRP, XCON, or XMPP) or the application definition to decide which protocol slots can hold nickname strings, who is supposed to enforce the rules, and when during protocol processing or interface handling the rules actually need to be enforced. for guidelines on using PRECIS profiles in applications, see Section 6 of [RFC7564] π
above and beyond the PRECIS-based rules here, application protocols can also add their own rules for nickname strings π think minimum or maximum length, extra character restrictions or character ranges, safeguards against visually similar characters, etc.
apps can also set rules for how nicknames actually get used (reserved nicknames, authorization requirements, whether certain nicknames can be prohibited, handling of duplicates, the relationship between nicknames and underlying identifiers such as SIP URIs or Jabber IDs, etc.) π«Ά
entities that enforce the rules in this document are encouraged to be liberal in what they accept, using this procedure:
- where possible, map characters (e.g., through width mapping, additional mapping, case mapping, or normalization) and accept the mapped string.
- if mapping is not possible (e.g., because a character is disallowed in the FreeformClass), reject the string. β
5. IANA Considerations π
the IANA shall add the following entry to the PRECIS Profiles Registry π
Name: Nickname
Base Class: FreeformClass
Applicability: Nicknames in messaging and text conferencing
technologies; petnames for devices, accounts, and people; and
other uses of nicknames or petnames.
Replaces: None
Width Mapping Rule: None (handled via NFKC)
Additional Mapping Rule: Map non-ASCII space characters to ASCII
space, strip leading and trailing space characters, map interior
sequences of multiple space characters to a single ASCII space.
Case Mapping Rule: Map uppercase and titlecase characters to
lowercase using Unicode Default Case Folding.
Normalization Rule: NFKC
Directionality Rule: None
Enforcement: To be specified by applications.
Specification: RFC 7700 (this document)
6. Security Considerations π₯
okay this part is SERIOUS bestie, so pay attention π
6.1. Reuse of PRECIS
the security considerations described in [RFC7564] apply to the FreeformClass string class used in this document for nicknames π
6.2. Reuse of Unicode
the security considerations described in [UTS39] apply to the use of Unicode characters in nicknames π
6.3. Visually Similar Characters
[RFC7564] describes some of the security considerations related to visually similar characters, also called "confusable characters" or "confusables" π
although the mapping rules defined in Section 2 of this document are designed, in part, to reduce the possibility of confusion about nicknames, this document does not provide more-detailed recommendations regarding the handling of visually similar characters, such as those provided in [UTS39]. so like, the mapping helps, but it's not the whole fix. go read [UTS39] for the deeper stuff π
7. References π
7.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997,
<http://www.rfc-editor.org/info/rfc2119>.
[RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO
10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November
2003, <http://www.rfc-editor.org/info/rfc3629>.
[RFC5893] Alvestrand, H., Ed. and C. Karp, "Right-to-Left Scripts
for Internationalized Domain Names for Applications
(IDNA)", RFC 5893, DOI 10.17487/RFC5893, August 2010,
<http://www.rfc-editor.org/info/rfc5893>.
[RFC6365] Hoffman, P. and J. Klensin, "Terminology Used in
Internationalization in the IETF", BCP 166, RFC 6365,
DOI 10.17487/RFC6365, September 2011,
<http://www.rfc-editor.org/info/rfc6365>.
[RFC7564] Saint-Andre, P. and M. Blanchet, "PRECIS Framework:
Preparation, Enforcement, and Comparison of
Internationalized Strings in Application Protocols",
RFC 7564, DOI 10.17487/RFC7564, May 2015,
<http://www.rfc-editor.org/info/rfc7564>.
[Unicode] The Unicode Consortium, "The Unicode Standard",
<http://www.unicode.org/versions/latest/>.
[Unicode7.0]
The Unicode Consortium, "The Unicode Standard, Version
7.0.0", 2014,
<http://www.unicode.org/versions/Unicode7.0.0/>.
[UTS39] The Unicode Consortium, "Unicode Technical Standard #39:
Unicode Security Mechanisms", November 2013,
<http://unicode.org/reports/tr39/>.
7.2. Informative References
[PETNAME-SYSTEMS]
Stiegler, M., "An Introduction to Petname Systems",
updated June 2012, February 2005,
<http://www.skyhunter.com/marcs/petnames/
IntroPetNames.html>.
[RFC20] Cerf, V., "ASCII format for network interchange", STD 80,
RFC 20, DOI 10.17487/RFC0020, October 1969,
<http://www.rfc-editor.org/info/rfc20>.
[RFC2811] Kalt, C., "Internet Relay Chat: Channel Management",
RFC 2811, DOI 10.17487/RFC2811, April 2000,
<http://www.rfc-editor.org/info/rfc2811>.
[RFC4975] Campbell, B., Ed., Mahy, R., Ed., and C. Jennings, Ed.,
"The Message Session Relay Protocol (MSRP)", RFC 4975,
DOI 10.17487/RFC4975, September 2007,
<http://www.rfc-editor.org/info/rfc4975>.
[RFC5239] Barnes, M., Boulton, C., and O. Levin, "A Framework for
Centralized Conferencing", RFC 5239, DOI 10.17487/RFC5239,
June 2008, <http://www.rfc-editor.org/info/rfc5239>.
[RFC5322] Resnick, P., Ed., "Internet Message Format", RFC 5322,
DOI 10.17487/RFC5322, October 2008,
<http://www.rfc-editor.org/info/rfc5322>.
[RFC6120] Saint-Andre, P., "Extensible Messaging and Presence
Protocol (XMPP): Core", RFC 6120, DOI 10.17487/RFC6120,
March 2011, <http://www.rfc-editor.org/info/rfc6120>.
[RFC7701] Niemi, A., Garcia-Martin, M., and G. Sandbakken, "Multi-
party Chat Using the Message Session Relay Protocol
(MSRP)", RFC 7701, DOI 10.17487/RFC7701, December 2015,
<http://www.rfc-editor.org/info/rfc7701>.
[XCON-SYSTEM]
Barnes, M., Boulton, C., and S. Loreto, "Chatrooms within
a Centralized Conferencing (XCON) System", Work in
Progress, draft-boulton-xcon-session-chat-08, July 2012.
[XEP-0045]
Saint-Andre, P., "Multi-User Chat", XSF XEP 0045, February
2012, <http://xmpp.org/extensions/xep-0045.html>.
[XEP-0172]
Saint-Andre, P. and V. Mercier, "User Nickname", XSF
XEP 0172, March 2012,
<http://xmpp.org/extensions/xep-0172.html>.
Acknowledgements π«Ά
thanks to Kim Alvefur, Mary Barnes, Ben Campbell, Dave Cridland, Miguel Garcia, Salvatore Loreto, Enrico Marocco, Matt Miller, and Yoshiro YONEYA for their reviews and comments π
Paul Kyzivat and Melinda Shore reviewed the document for the General Area Review Team and Operations Directorate, respectively π·
during IESG review, Ben Campbell and Kathleen Moriarty provided comments that led to further improvements β¨
thanks to Matt Miller as Document Shepherd, Pete Resnick and Andrew Sullivan as IANA Designated Experts, Marc Blanchet and Alexey Melnikov as working group Chairs, and Barry Leiba as Area Director π
the author wishes to acknowledge Cisco Systems, Inc., for employing him during his work on earlier draft versions of this document π
Author's Address π¦
Peter Saint-Andre
&yet
Email: peter@andyet.com
URI: https://andyet.com/
π¦ where this page comes from
- ietf: rfc7700 2015-12
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms