Skip to main content
toUnicode - punycode - Node documentation
function toUnicode

Usage in Deno

import { toUnicode } from "node:punycode";
toUnicode(domain: string): string

The punycode.toUnicode() method converts a string representing a domain name containing Punycode encoded characters into Unicode. Only the Punycode encoded parts of the domain name are be converted.

// decode domain names
punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com'
punycode.toUnicode('xn----dqo34k.com');  // '☃-⌘.com'
punycode.toUnicode('example.com');       // 'example.com'

Parameters

domain: string

Return Type

string
Back to top