3 ms·
This design doc from DyND (a possible NumPy alternative) has some useful references on this point: https://github.com/libdynd/libdynd/blob/master/docs/string-de
by shoyer 11y ago
This design doc from DyND (a possible NumPy alternative) has some useful references on this point:
https://github.com/libdynd/libdynd/blob/master/docs/string-design.md#code-unit-api-not-code-point https://github.com/libdynd/libdynd/blob/master/docs/string-d...
- rurban 11y agoNope. This is just a normal short-string implementation, inlined with 64bit systems, with a tag bit. Very common on every better VM. This has nothing to do with (inefficient) encodings, and their bad historic namings, probably derived from perl. Of course any name like byte2utf8 or just to_byte or b2u8 would have been better than encode/decode. And of course cache size matters nowadays much more than immediate substring access for utf8, so nobody should use ucs-2 or even ucs-4 internally. This is easily benchmarkable.
- 0x0 11y ago"Byte2utf8" is a pretty confusing name for a method, considering utf8 is a byte encoding of unicode... :)