3 ms·
Theoretically, UTF-8 can encode up to 31 bits (U+7FFF'FFFF)[0], but for compatibility with UTF-16's surrogates, it's officially capped to 21 bits with the max b
by colejohnson66 4y ago
Theoretically, UTF-8 can encode up to 31 bits (U+7FFF'FFFF)[0], but for compatibility with UTF-16's surrogates, it's officially capped to 21 bits with the max being U+10'FFFF[1]. That decision was made November 2003, so there's two decades of software written with hard caps of U+10'FFFF.
[0]: https://www.rfc-editor.org/rfc/rfc2279 https://www.rfc-editor.org/rfc/rfc2279
[1]: https://www.rfc-editor.org/rfc/rfc3629#section-3 https://www.rfc-editor.org/rfc/rfc3629#section-3