More concise encode_wtf8 using ucs2decode/encode_wtf8_single logic.
Encodes a slice of Unicode scalar codepoints to WTF-8 bytes.
Surrogate pairs are combined and encoded as a single codepoint.
Unpaired surrogates are encoded as 3-byte WTF-8 sequences.
Values higher than 0x10FFFF are not supported.
Encode a single Unicode codepoint as WTF-8 byte array.
Returns a Vec<u8> containing the WTF-8 encoding of the codepoint.
Surrogates and non-scalar values are encoded as WTF-8 allows.
Values higher than 0x10FFFF are not supported.