Inheritance diagram for UDomainName:
Public Types | |
enum | Options { Strict, Lenient, Std3 } |
Public Member Functions | |
this (UText text) | |
void | toAscii (UString dst, Options o=Options.Strict) |
void | toUnicode (UString dst, Options o=Options.Strict) |
void | IdnToAscii (UString dst, Options o=Options.Strict) |
void | IdnToUnicode (UString dst, Options o=Options.Strict) |
int | compare (UString other, Options o=Options.Strict) |
Static Public Member Functions | |
this () | |
~this () | |
Static Public Attributes | |
FunctionLoader Bind[] | targets |
Private Types | |
typedef void * | Handle |
enum | Error { OK, BufferOverflow = 15 } |
Static Private Member Functions | |
bool | isError (Error e) |
void | testError (Error e, char[] msg) |
char * | toString (char[] string) |
wchar * | toString (wchar[] string) |
uint | length (char *s) |
uint | length (wchar *s) |
char[] | toArray (char *s) |
wchar[] | toArray (wchar *s) |
Private Attributes | |
UText | text |
Handle | handle |
Static Private Attributes | |
void * | library |
The RFC defines 2 operations: toAscii and toUnicode. Domain labels containing non-ASCII code points are required to be processed by toAscii operation before passing it to resolver libraries. Domain names that are obtained from resolver libraries are required to be processed by toUnicode operation before displaying the domain name to the user. IDNA requires that implementations process input strings with Nameprep (http://www.ietf.org/rfc/rfc3491.txt), which is a profile of Stringprep (http://www.ietf.org/rfc/rfc3454.txt), and then with Punycode (http://www.ietf.org/rfc/rfc3492.txt). Implementations of IDNA MUST fully implement Nameprep and Punycode; neither Nameprep nor Punycode are optional.
The input and output of toAscii() and ToUnicode() operations are Unicode and are designed to be chainable, i.e., applying toAscii() or toUnicode() operations multiple times to an input string will yield the same result as applying the operation once.
See this page for full details.
Definition at line 118 of file UDomainName.d.
|
Use this for the primary argument-type to most ICU functions |
|
Definition at line 123 of file UDomainName.d. |
|
ICU error codes (the ones which are referenced) |
|
Definition at line 317 of file UDomainName.d. |
|
Definition at line 136 of file UDomainName.d. |
|
This function implements the ToASCII operation as defined in the IDNA RFC. This operation is done on single labels before sending it to something that expects ASCII names. A label is an individual part of a domain name. Labels are usually separated by dots; e.g." "www.example.com" is composed of 3 labels "www","example", and "com". Definition at line 154 of file UDomainName.d. References UString::format(), UText::get(), and UText::len. |
|
This function implements the ToUnicode operation as defined in the IDNA RFC. This operation is done on single labels before sending it to something that expects Unicode names. A label is an individual part of a domain name. Labels are usually separated by dots; for e.g." "www.example.com" is composed of 3 labels "www","example", and "com". Definition at line 177 of file UDomainName.d. References UString::format(), UText::get(), and UText::len. |
|
Convenience function that implements the IDNToASCII operation as defined in the IDNA RFC. This operation is done on complete domain names, e.g: "www.example.com". It is important to note that this operation can fail. If it fails, then the input domain name cannot be used as an Internationalized Domain Name and the application should have methods defined to deal with the failure. Note: IDNA RFC specifies that a conformant application should divide a domain name into separate labels, decide whether to apply allowUnassigned and useSTD3ASCIIRules on each, and then convert. This function does not offer that level of granularity. The options once set will apply to all labels in the domain name Definition at line 208 of file UDomainName.d. References UString::format(), UText::get(), and UText::len. |
|
Convenience function that implements the IDNToUnicode operation as defined in the IDNA RFC. This operation is done on complete domain names, e.g: "www.example.com". Note: IDNA RFC specifies that a conformant application should divide a domain name into separate labels, decide whether to apply allowUnassigned and useSTD3ASCIIRules on each, and then convert. This function does not offer that level of granularity. The options once set will apply to all labels in the domain name Definition at line 235 of file UDomainName.d. References UString::format(), UText::get(), and UText::len. |
|
Compare two IDN strings for equivalence. This function splits the domain names into labels and compares them. According to IDN RFC, whenever two labels are compared, they are considered equal if and only if their ASCII forms (obtained by applying toASCII) match using an case-insensitive ASCII comparison. Two domain names are considered a match if and only if all labels match regardless of whether label separators match Definition at line 259 of file UDomainName.d. References UText::get(), UText::len, and ICU::testError(). |
|
Definition at line 308 of file UDomainName.d. |
|
Definition at line 110 of file ICU.d. Referenced by UConverter::detectSignature(), UString::format(), UCollator::getLocale(), and UConverter::this(). |
|
|
|
Definition at line 160 of file ICU.d. References string. |
|
Definition at line 182 of file ICU.d. References strlen(). |
|
Definition at line 191 of file ICU.d. References wcslen(). |
|
Definition at line 200 of file ICU.d. References strlen(). Referenced by UConverter::detectSignature(), UResourceBundle::getKey(), UResourceBundle::getLocale(), UMessageFormat::getLocale(), UCollator::getLocale(), UConverter::getName(), UChar::getPropertyName(), UChar::getPropertyValueName(), and UConverter::opApply(). |
|
Definition at line 211 of file ICU.d. References wcslen(). |
|
Definition at line 120 of file UDomainName.d. |
|
Definition at line 121 of file UDomainName.d. |
|
Bind the ICU functions from a shared library. This is complicated by the issues regarding D and DLLs on the Windows platform Definition at line 276 of file UDomainName.d. |
|
Initial value: [ {cast(void**) &uidna_toASCII, "uidna_toASCII"} Definition at line 295 of file UDomainName.d. |