Skip to main content
Deno 2 is finally here 🎉️
Learn more
Latest
function toASCII
import { toASCII } from "https://deno.land/x/denogres@v4.0.1/vendor/deno.land/std@0.173.0/node/internal/idna.ts";

Converts a Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the domain name will be converted, i.e. it doesn't matter if you call it with a domain that's already in ASCII.

Parameters

input: string

The domain name or email address to convert, as a Unicode string.

Returns

string

The Punycode representation of the given domain name or email address.