How UTF-16 Encoding Works

This post explains exactly how UTF-16 encodes Unicode code points into bytes. If you haven&rsquo;t read the history of how we got here, see The History of Text Encoding . From UCS-2 to UTF-16 Originally, Unicode was designed to fit in 16 bits - the Basic Multilingual Plane (BMP) , covering code points U+0000 to U+FFFF. The encoding UCS-2 simply stored each code point as a 16-bit integer. When…