UnicodeIdnaOptions Class
Specifies the flags of Unicode IDNA Compatibility Processing used by UnicodeIdna.
public sealed class UnicodeIdnaOptionsRemarks
The default values are the ones of the standard for the registration and the lookup of a domain name.
See also
Constructors
| Name | Description |
|---|---|
| UnicodeIdnaOptions() |
UnicodeIdnaOptions()
UnicodeIdnaOptions.cspublic UnicodeIdnaOptions()No documentation is available.
Properties
| Name | Description |
|---|---|
| CheckBidi | Gets a value indicating whether the labels of a domain name that contains right-to-left characters must satisfy the Bidi Rule of RFC 5893 (CheckBidi). The default is true. |
| CheckHyphens | Gets a value indicating whether a label cannot start or end with a hyphen, or have hyphens in its third and fourth positions (CheckHyphens). The default is true. |
| CheckJoiners | Gets a value indicating whether the zero-width joiner and non-joiner must satisfy the ContextJ rules of RFC 5892 (CheckJoiners). The default is true. |
| Default | Gets the default options: every check is enabled, with nontransitional processing. |
| IgnoreInvalidPunycode | Gets a value indicating whether a label that starts with xn-- but is not valid Punycode is kept as it is and checked like a decoded label, instead of being an error right away (IgnoreInvalidPunycode). The default is false. |
| TransitionalProcessing | Gets a value indicating whether the deviation characters, such as ß, are mapped as in IDNA2003 (Transitional_Processing). The default is false. |
| UseStd3AsciiRules | Gets a value indicating whether the only ASCII characters a label accepts are the lowercase letters, the digits and the hyphen (UseSTD3ASCIIRules). The default is true. |
| VerifyDnsLength | Gets a value indicating whether UnicodeIdna.TryToAscii rejects a domain name or a label that is empty or too long for the DNS (VerifyDnsLength). The default is true. |
CheckBidi
UnicodeIdnaOptions.csCheckHyphens
UnicodeIdnaOptions.csCheckJoiners
UnicodeIdnaOptions.csDefault
UnicodeIdnaOptions.csGets the default options: every check is enabled, with nontransitional processing.
public static UnicodeIdnaOptions Default { get; }Property value
IgnoreInvalidPunycode
UnicodeIdnaOptions.csGets a value indicating whether a label that starts with xn-- but is not valid Punycode is kept as it is and checked like a decoded label, instead of being an error right away (IgnoreInvalidPunycode). The default is false.
public bool IgnoreInvalidPunycode { get; init; }Property value
Remarks
As UTS #46 specifies, the kept label is still an error: it contains only ASCII characters, which is an error for a label that starts with xn--, and it does not satisfy the validity criteria either (its hyphens, or its xn-- prefix when UnicodeIdnaOptions.CheckHyphens is false). So the option does not make such a domain name valid: UnicodeIdna.TryToAscii rejects it, and UnicodeIdna.ToUnicode keeps the label and reports an error, with or without the option.
TransitionalProcessing
UnicodeIdnaOptions.csUseStd3AsciiRules
UnicodeIdnaOptions.csVerifyDnsLength
UnicodeIdnaOptions.csGets a value indicating whether UnicodeIdna.TryToAscii rejects a domain name or a label that is empty or too long for the DNS (VerifyDnsLength). The default is true.
public bool VerifyDnsLength { get; init; }