3 ms·
It's also the case that `char` in Rust is a 32-bit primitive. Though, `String` being UTF-8 is convenient until you need to do Unicode operations on actual chars
by jaxrtech 4y ago
It's also the case that `char` in Rust is a 32-bit primitive. Though, `String` being UTF-8 is convenient until you need to do Unicode operations on actual chars...
It is surely better than dealing with UTF-16 "surrogate pairs"[2] in most pre-UTF-8 tech where a `char` is 16-bits but can't fit all Unicode codepoints without another 16-bit `char`.
[1]: https://doc.rust-lang.org/std/primitive.char.html#representation https://doc.rust-lang.org/std/primitive.char.html#representa...
[2]: https://stackoverflow.com/a/54922477/809572 https://stackoverflow.com/a/54922477/809572
- kqr 4y agoWell, it's not like we don't have plenty of combining marks in Unicode itself, so I suspect this is something you have to deal with either way.