The IDNA2008 rules for code points in U-labels: the derived property of RFC 5892, the contextual rules of its Appendix A, and the Bidi rule of RFC 5893.
The derived property is computed from the Unicode data OTP ships
(:unicode_util: general category, canonical combining class, and
normalization), so it follows the Unicode version of the running OTP
instead of a fixed table. OTP has no Bidi_Class, Script, or
Joining_Type data: the Bidi rule and the contextual rules use the
Unicode blocks of the scripts concerned instead, and a zero-width
non-joiner is only allowed after a virama (the regular-expression
rule, which needs Joining_Type, is not applied). Both only make the
rules stricter.
Summary
Types
RFC 5892 §2: what a code point may be used for.
Functions
Whether a label satisfies the Bidi rule (RFC 5893 §2).
Whether a code point is a combining mark (Mn, Mc, or Me).
Checks the CONTEXTJ or CONTEXTO code point at index of label (a
list of code points).
The IDNA2008 derived property of a code point (RFC 5892 §3).
Whether a label has right-to-left characters (Bidi classes R, AL, or AN), which makes its domain a "Bidi domain name".
Types
Functions
@spec bidi?([non_neg_integer()]) :: boolean()
Whether a label satisfies the Bidi rule (RFC 5893 §2).
@spec combining_mark?(non_neg_integer()) :: boolean()
Whether a code point is a combining mark (Mn, Mc, or Me).
@spec context?([non_neg_integer()], non_neg_integer()) :: boolean()
Checks the CONTEXTJ or CONTEXTO code point at index of label (a
list of code points).
@spec property(non_neg_integer()) :: property()
The IDNA2008 derived property of a code point (RFC 5892 §3).
iex> Sovite.IDNA.CodePoints.property(?a)
:pvalid
iex> Sovite.IDNA.CodePoints.property(?A)
:disallowed
iex> Sovite.IDNA.CodePoints.property(0x200D)
:contextj
@spec rtl?([non_neg_integer()]) :: boolean()
Whether a label has right-to-left characters (Bidi classes R, AL, or AN), which makes its domain a "Bidi domain name".