IT notes


To encode/decode a domain using “Internationalized Domain Names” $ python >>> x = u'qé' >>> x.encode('idna') b'' >>> x.encode('idna').decode('idna') 'qé' >>> x == x.encode('idna').decode('idna') True To prevent non-international domain names containing hyphens from being accidentally interpreted as Punycode, international domain name Punycode sequences have a so-called ASCII Compatible Encoding (ACE) prefix, “xn–”, prepended.[2] Thus the domain name “bücher.tld” would be represented in ASCII as “xn–bcher-kva.tld”.