Skip to main content
toUnicode - node__punycode.d.ts - Node documentation
function toUnicode

Usage in Deno

```typescript import { toUnicode } from "node:node__punycode.d.ts"; ```
toUnicode(domain: string): string
The `punycode.toUnicode()` method converts a string representing a domain name containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492) encoded parts of the domain name are be converted. ```js // 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