idnaToASCII
fn
string idnaToASCII(string domain) @safeConvert 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
domain | Domain name to convert. |
Returns
ASCII domain name.
Throws
Exception if label/domain length constraints fail.IDNA ToASCII with options.
Parameters
domain | Domain name to convert. |
opt | IDNA options. |
Returns
ASCII domain name.
Throws
Exception if validation or label/domain length constraints fail.