chickadee » punycode



RFC 3492 Punycode implementation for CHICKEN Scheme. Encodes internationalized domain names in the ASCII subset supported by DNS. Useful if you want to display unicode domains in your user interface or accept unicode domains as input.


(punycode-encode str) procedure

Converts a unicode string to Punycode ASCII.

(punycode-decode str) procedure

Converts a Punycode ASCII string to unicode.

(domain->ascii str) procedure

Converts a internationalized domain name to an ASCII representation (if the domain is already ASCII-only it is returned unmodified).

(domain->unicode str) procedure

Converts a Punycode ASCII domain name to a unicode string (if the domain is already unicode it is returned unmodified).


(use punycode)

(punycode-encode "Bücher")
;; => "Bcher-kva"

(punycode-decode "Bcher-kva")
;; => "Bücher"

(domain->ascii "www.bü")
;; => ""

(domain->unicode "")
;; => "www.bü"

Source code / Issues

Contents »