Unlike emails, JIDs were defined with Internationalization (i18n) in mind using the Preparation, Enforcement, and Comparison of Internationalized Strings (PRECIS) framework. PRECIS (defined in RFC 7564), is a framework for comparing strings safely in a variety of contexts. For instance, imagine you have registered the nickname “Richard IV” (Latin capital letters I, Vee) in a group chat: Using PRECIS the chat application could ensure that no one else comes along and registers the nickname “Richard Ⅳ” (Unicode Roman Numeral 4) and uses it to impersonate you.
The algorithm for validating a JID that has already been split into its localpart, domainpart, and resourcepart (See: Splitting a JID (generic) for information on extracing the parts of a JID from a string) is as follows:
The Validations
step should perform the following:
"&'/:<>@
[::1]
instead of ::1
)