mscorlib(4.0.0.0) API with additions
System.Globalization.IdnMapping Class Reference

Supports the use of non-ASCII characters for Internet domain names. This class cannot be inherited. More...

Public Member Functions

string GetAscii (string unicode)
 Encodes a string of domain name labels that consist of Unicode characters to a string of displayable Unicode characters in the US-ASCII character range. The string is formatted according to the IDNA standard. More...
 
string GetAscii (string unicode, int index)
 Encodes a substring of domain name labels that include Unicode characters outside the US-ASCII character range. The substring is converted to a string of displayable Unicode characters in the US-ASCII character range and is formatted according to the IDNA standard. More...
 
string GetAscii (string unicode, int index, int count)
 Encodes the specified number of characters in a substring of domain name labels that include Unicode characters outside the US-ASCII character range. The substring is converted to a string of displayable Unicode characters in the US-ASCII character range and is formatted according to the IDNA standard. More...
 
string GetUnicode (string ascii)
 Decodes a string of one or more domain name labels, encoded according to the IDNA standard, to a string of Unicode characters. More...
 
string GetUnicode (string ascii, int index)
 Decodes a substring of one or more domain name labels, encoded according to the IDNA standard, to a string of Unicode characters. More...
 
string GetUnicode (string ascii, int index, int count)
 Decodes a substring of a specified length that contains one or more domain name labels, encoded according to the IDNA standard, to a string of Unicode characters. More...
 
override bool Equals (object obj)
 Indicates whether a specified object and the current T:System.Globalization.IdnMapping object are equal. More...
 
override int GetHashCode ()
 Returns a hash code for this T:System.Globalization.IdnMapping object. More...
 

Properties

bool AllowUnassigned [get, set]
 Gets or sets a value that indicates whether unassigned Unicode code points are used in operations performed by members of the current T:System.Globalization.IdnMapping object. More...
 
bool UseStd3AsciiRules [get, set]
 Gets or sets a value that indicates whether standard or relaxed naming conventions are used in operations performed by members of the current T:System.Globalization.IdnMapping object. More...
 

Detailed Description

Supports the use of non-ASCII characters for Internet domain names. This class cannot be inherited.

Definition at line 8 of file IdnMapping.cs.

Member Function Documentation

◆ Equals()

override bool System.Globalization.IdnMapping.Equals ( object  obj)

Indicates whether a specified object and the current T:System.Globalization.IdnMapping object are equal.

Parameters
objThe object to compare to the current object.
Returns
true if the object specified by the obj parameter is derived from T:System.Globalization.IdnMapping and its P:System.Globalization.IdnMapping.AllowUnassigned and P:System.Globalization.IdnMapping.UseStd3AsciiRules properties are equal; otherwise, false.

Definition at line 319 of file IdnMapping.cs.

◆ GetAscii() [1/3]

string System.Globalization.IdnMapping.GetAscii ( string  unicode)

Encodes a string of domain name labels that consist of Unicode characters to a string of displayable Unicode characters in the US-ASCII character range. The string is formatted according to the IDNA standard.

Parameters
unicodeThe string to convert, which consists of one or more domain name labels delimited with label separators.
Returns
The equivalent of the string specified by the unicode parameter, consisting of displayable Unicode characters in the US-ASCII character range (U+0020 to U+007E) and formatted according to the IDNA standard.
Exceptions
T:System.ArgumentNullExceptionunicode is null.
T:System.ArgumentExceptionunicode is invalid based on the P:System.Globalization.IdnMapping.AllowUnassigned and P:System.Globalization.IdnMapping.UseStd3AsciiRules properties, and the IDNA standard.

Definition at line 89 of file IdnMapping.cs.

◆ GetAscii() [2/3]

string System.Globalization.IdnMapping.GetAscii ( string  unicode,
int  index 
)

Encodes a substring of domain name labels that include Unicode characters outside the US-ASCII character range. The substring is converted to a string of displayable Unicode characters in the US-ASCII character range and is formatted according to the IDNA standard.

Parameters
unicodeThe string to convert, which consists of one or more domain name labels delimited with label separators.
indexA zero-based offset into unicode that specifies the start of the substring to convert. The conversion operation continues to the end of the unicode string.
Returns
The equivalent of the substring specified by the unicode and index parameters, consisting of displayable Unicode characters in the US-ASCII character range (U+0020 to U+007E) and formatted according to the IDNA standard.
Exceptions
T:System.ArgumentNullExceptionunicode is null.
T:System.ArgumentOutOfRangeExceptionindex is less than zero.-or- index is greater than the length of unicode .
T:System.ArgumentExceptionunicode is invalid based on the P:System.Globalization.IdnMapping.AllowUnassigned and P:System.Globalization.IdnMapping.UseStd3AsciiRules properties, and the IDNA standard.

Definition at line 105 of file IdnMapping.cs.

◆ GetAscii() [3/3]

string System.Globalization.IdnMapping.GetAscii ( string  unicode,
int  index,
int  count 
)

Encodes the specified number of characters in a substring of domain name labels that include Unicode characters outside the US-ASCII character range. The substring is converted to a string of displayable Unicode characters in the US-ASCII character range and is formatted according to the IDNA standard.

Parameters
unicodeThe string to convert, which consists of one or more domain name labels delimited with label separators.
indexA zero-based offset into unicode that specifies the start of the substring.
countThe number of characters to convert in the substring that starts at the position specified by index in the unicode string.
Returns
The equivalent of the substring specified by the unicode , index , and count parameters, consisting of displayable Unicode characters in the US-ASCII character range (U+0020 to U+007E) and formatted according to the IDNA standard.
Exceptions
T:System.ArgumentNullExceptionunicode is null.
T:System.ArgumentOutOfRangeExceptionindex or count is less than zero.-or- index is greater than the length of unicode .-or- index is greater than the length of unicode minus count .
T:System.ArgumentExceptionunicode is invalid based on the P:System.Globalization.IdnMapping.AllowUnassigned and P:System.Globalization.IdnMapping.UseStd3AsciiRules properties, and the IDNA standard.

Definition at line 127 of file IdnMapping.cs.

◆ GetHashCode()

override int System.Globalization.IdnMapping.GetHashCode ( )

Returns a hash code for this T:System.Globalization.IdnMapping object.

Returns
One of four 32-bit signed constants derived from the properties of an T:System.Globalization.IdnMapping object. The return value has no special meaning and is not suitable for use in a hash code algorithm.

Definition at line 335 of file IdnMapping.cs.

◆ GetUnicode() [1/3]

string System.Globalization.IdnMapping.GetUnicode ( string  ascii)

Decodes a string of one or more domain name labels, encoded according to the IDNA standard, to a string of Unicode characters.

Parameters
asciiThe string to decode, which consists of one or more labels in the US-ASCII character range (U+0020 to U+007E) encoded according to the IDNA standard.
Returns
The Unicode equivalent of the IDNA substring specified by the ascii parameter.
Exceptions
T:System.ArgumentNullExceptionascii is null.
T:System.ArgumentExceptionascii is invalid based on the P:System.Globalization.IdnMapping.AllowUnassigned and P:System.Globalization.IdnMapping.UseStd3AsciiRules properties, and the IDNA standard.

Definition at line 214 of file IdnMapping.cs.

◆ GetUnicode() [2/3]

string System.Globalization.IdnMapping.GetUnicode ( string  ascii,
int  index 
)

Decodes a substring of one or more domain name labels, encoded according to the IDNA standard, to a string of Unicode characters.

Parameters
asciiThe string to decode, which consists of one or more labels in the US-ASCII character range (U+0020 to U+007E) encoded according to the IDNA standard.
indexA zero-based offset into ascii that specifies the start of the substring to decode. The decoding operation continues to the end of the ascii string.
Returns
The Unicode equivalent of the IDNA substring specified by the ascii and index parameters.
Exceptions
T:System.ArgumentNullExceptionascii is null.
T:System.ArgumentOutOfRangeExceptionindex is less than zero.-or- index is greater than the length of ascii .
T:System.ArgumentExceptionascii is invalid based on the P:System.Globalization.IdnMapping.AllowUnassigned and P:System.Globalization.IdnMapping.UseStd3AsciiRules properties, and the IDNA standard.

Definition at line 230 of file IdnMapping.cs.

◆ GetUnicode() [3/3]

string System.Globalization.IdnMapping.GetUnicode ( string  ascii,
int  index,
int  count 
)

Decodes a substring of a specified length that contains one or more domain name labels, encoded according to the IDNA standard, to a string of Unicode characters.

Parameters
asciiThe string to decode, which consists of one or more labels in the US-ASCII character range (U+0020 to U+007E) encoded according to the IDNA standard.
indexA zero-based offset into ascii that specifies the start of the substring.
countThe number of characters to convert in the substring that starts at the position specified by index in the ascii string.
Returns
The Unicode equivalent of the IDNA substring specified by the ascii , index , and count parameters.
Exceptions
T:System.ArgumentNullExceptionascii is null.
T:System.ArgumentOutOfRangeExceptionindex or count is less than zero.-or- index is greater than the length of ascii .-or- index is greater than the length of ascii minus count .
T:System.ArgumentExceptionascii is invalid based on the P:System.Globalization.IdnMapping.AllowUnassigned and P:System.Globalization.IdnMapping.UseStd3AsciiRules properties, and the IDNA standard.

Definition at line 252 of file IdnMapping.cs.

Property Documentation

◆ AllowUnassigned

bool System.Globalization.IdnMapping.AllowUnassigned
getset

Gets or sets a value that indicates whether unassigned Unicode code points are used in operations performed by members of the current T:System.Globalization.IdnMapping object.

Returns
true if unassigned code points are used in operations; otherwise, false.

Definition at line 56 of file IdnMapping.cs.

◆ UseStd3AsciiRules

bool System.Globalization.IdnMapping.UseStd3AsciiRules
getset

Gets or sets a value that indicates whether standard or relaxed naming conventions are used in operations performed by members of the current T:System.Globalization.IdnMapping object.

Returns
true if standard naming conventions are used in operations; otherwise, false.

Definition at line 71 of file IdnMapping.cs.


The documentation for this class was generated from the following file: