A robust javascript Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms

Allows you to do stuff like:

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

// encode/decode domain name parts
punycode.encode('mañana'); // 'maana-pta'
punycode.decode('maana-pta'); // 'mañana'
punycode.encode('☃-⌘'); // '--dqo34k'
punycode.decode('--dqo34k'); // '☃-⌘'

punycode.js →

Published by Bramus!

Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. From the moment he discovered view-source at the age of 14 (way back in 1997), he fell in love with the web and has been tinkering with it ever since (more …)

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.