Nope. This is just a normal short-string implementation, inlined with 64bit systems, with a tag bit.
Very common on every better VM.<p>This has nothing to do with (inefficient) encodings, and their bad historic namings, probably derived from perl.<p>Of course any name like byte2utf8 or just to_byte or b2u8 would have been better than encode&#x2F;decode.<p>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.