TLDR · PROGRAMMING, DESIGN & DATA SCIENCE
PUNYCODE: MY NEW FAVORITE ALGORITHM
Summary from the TLDR newsletter
Punycode is a special encoding used to convert Unicode characters to ASCII. It's deceptively simple on the surface, but there's real sophistication in how it manages the problems inherent in encoding arbitrary Unicode within DNS' ASCII-only infrastructure. The algorithm uses adaptive bias adjustment, variable-length encoding, and delta compression to achieve extremely dense results. This article looks at how to encode arbitrary Unicode within DNS's ASCII-only infrastructure. It provides a step-through visualizer at the end that lets readers watch the algorithm encode domains from various scripts.