0

Decoded

Punycode IDN

Encoded

Punycode IDN

About Punycode IDN

Punycode is an encoding method for representing Unicode strings using only ASCII characters. It is mainly used to convert internationalized domain names (IDNs), such as domain names containing Japanese, Chinese, Korean, or accented Latin characters, into an ASCII form that can be handled by DNS.

In an internationalized domain name, each domain label is converted with Punycode and the converted label is prefixed with xn--. This ASCII form is called an A-label, while the original Unicode form is called a U-label.

For example, converting “ドメイン.com” to Punycode IDN produces the following.

xn--eckwd4c7c.com

In this example, the top-level domain com contains only ASCII characters and remains unchanged; only the “ドメイン” label is converted to xn--eckwd4c7c.

Unicode formPunycode IDN formDescription
ドメイン.comxn--eckwd4c7c.comDomain name containing Japanese characters.
例え.テストxn--r8jz45g.xn--zckzahEach label is converted separately.
bücher.examplexn--bcher-kva.exampleExample containing an accented Latin character.

Punycode IDN is different from URL encoding. URL encoding represents characters in a URL as byte sequences such as %E3%81%82, while Punycode IDN converts domain-name labels into ASCII labels beginning with xn--.

Converting domain-name labels

A domain name is a sequence of labels separated by dots (.). Punycode IDN does not convert the whole domain name as one string; it converts each label separately.

LabelConversion result
例えxn--r8jz45g
テストxn--zckzah

Therefore, 例え.テスト is converted to xn--r8jz45g.xn--zckzah.