You've probably seen a domain like 한글.com show up as an odd xn-- string in a browser address bar or email header. Here's what that is and why it exists.
What Punycode is
The domain name system (DNS) was designed to support only ASCII characters. Punycode is the encoding devised to safely convert internationalized domain names (IDN) — containing Korean, Chinese, Arabic, and other Unicode scripts — into ASCII that DNS can handle. For example, "한글.com" becomes "xn--bj0bj06e.com".
Why it starts with xn--
xn-- is the ACE (ASCII Compatible Encoding) prefix, a standard marker (RFC 3492) indicating that what follows is a Unicode domain encoded in Punycode. Browsers recognize this prefix and decode it back to the original script for display.
Where this comes up in practice
You'll run into this when checking the source of an unfamiliar xn-- domain in an email header, when registering an internationalized domain in a server config like nginx (which needs the ASCII form), or when an SSL certificate's Common Name uses the Punycode form.
Spotting phishing with it
Some Unicode characters look nearly identical to Latin letters (Cyrillic, for instance), which enables "IDN homograph attacks" — a fake domain like "аpple.com" using a Cyrillic 'а'. Converting a suspicious domain to Punycode reveals its real character makeup, helping you judge whether it's legitimate.