4 ms·
Unicode: Every codepoint can be expressed in UTF-8.
by jonathankoren 3y ago
Unicode: Every codepoint can be expressed in UTF-8.
- 1-more 3y agowait can some not?
- CodesInChaos 3y agoUTF-16 surrogates are code-points, but UTF-8 prohibits encoding them. However unicode strings are sequences of unicode scalar values and can't contain surrogates, so you can encode every unicode string in UTF-8. (There is the WTF-8 encoding, which allows unpaired surrogates under certain circumstances. This can be useful for losslessly storing wide-strings (unvalidated UTF-16) in a UTF-8 like encoding, which are used by Windows, C#, Java and Javascript)
- 1-more 3y agoohhh that's a fun and subtle thing. Thanks!