idnaToASCII

fnstring idnaToASCII(string domain) @safe

Convert a domain name to its ASCII form using IDNA ToASCII (basic version).

Each label containing non-ASCII code points is Punycode-encoded and prefixed with xn--. Labels are lowercased. This function does not implement all IDNA2008 contextual rules or UTS #46 mappings, but handles the common cases.

Parameters

domainDomain name to convert.

Returns

ASCII domain name.

Throws

Exception if label/domain length constraints fail.
fnstring idnaToASCII(string domain, IdnaOptions opt) @safe

IDNA ToASCII with options.

Parameters

domainDomain name to convert.
optIDNA options.

Returns

ASCII domain name.

Throws

Exception if validation or label/domain length constraints fail.