idna

Function domain_to_ascii

source
pub fn domain_to_ascii(domain: &str) -> Result<String, Errors>
Expand description

The domain to ASCII algorithm; version returning String and no ASCII deny list (i.e. UseSTD3ASCIIRules=false).

This function exists for backward-compatibility. Consider using domain_to_ascii_cow instead.

Return the ASCII representation a domain name, normalizing characters (upper-case to lower-case and other kinds of equivalence) and using Punycode as necessary.

This process may fail.