UnicodeIdnaOptions Class

Specifies the flags of Unicode IDNA Compatibility Processing used by UnicodeIdna.

public sealed class UnicodeIdnaOptions

Remarks

The default values are the ones of the standard for the registration and the lookup of a domain name.

See also

Constructors

NameDescription
UnicodeIdnaOptions()

UnicodeIdnaOptions()

UnicodeIdnaOptions.cs
public UnicodeIdnaOptions()

No documentation is available.

Properties

NameDescription
CheckBidiGets 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.
CheckHyphensGets 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.
CheckJoinersGets a value indicating whether the zero-width joiner and non-joiner must satisfy the ContextJ rules of RFC 5892 (CheckJoiners). The default is true.
DefaultGets the default options: every check is enabled, with nontransitional processing.
IgnoreInvalidPunycodeGets 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.
TransitionalProcessingGets a value indicating whether the deviation characters, such as ß, are mapped as in IDNA2003 (Transitional_Processing). The default is false.
UseStd3AsciiRulesGets 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.
VerifyDnsLengthGets 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.

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.

public bool CheckBidi { get; init; }

Property value

bool

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.

public bool CheckHyphens { get; init; }

Property value

bool

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.

public bool CheckJoiners { get; init; }

Property value

bool

Gets the default options: every check is enabled, with nontransitional processing.

public static UnicodeIdnaOptions Default { get; }

Property value

UnicodeIdnaOptions

IgnoreInvalidPunycode

UnicodeIdnaOptions.cs

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.

public bool IgnoreInvalidPunycode { get; init; }

Property value

bool

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.cs

Gets a value indicating whether the deviation characters, such as ß, are mapped as in IDNA2003 (Transitional_Processing). The default is false.

public bool TransitionalProcessing { get; init; }

Property value

bool

Remarks

The standard deprecates transitional processing.

UseStd3AsciiRules

UnicodeIdnaOptions.cs

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.

public bool UseStd3AsciiRules { get; init; }

Property value

bool

VerifyDnsLength

UnicodeIdnaOptions.cs

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.

public bool VerifyDnsLength { get; init; }

Property value

bool