Node | URL.domainToUnicode

The url.domainToUnicode is an inbuilt application programming interface of class URL with in url module.

It returns the Unicode serialization of the domain. If the domain is invalid, the empty string is returned.



Syntax :

const url.domainToASCII

Domain value : string

Return value : string

Example :

filter_none

edit
close

play_arrow

link
brightness_4
code

const url = require('url');
console.log(url.domainToUnicode('xn--espaol-zwa.com'));
  
console.log(url.domainToUnicode('xn--fiq228c.com'));
  
console.log(url.domainToUnicode('xn--iñvalid.com'));

chevron_right


OUTPUT:

español.com
??.com
//Empty String will be printed for third case

Note : It performs the inverse operation to url.domainToASCII().



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :

1


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.