Word description Encodes a string together with a trailing null code point using the given encoding, and stores the resulting bytes in a freshly-allocated byte array.
Errors Throws an error if the string contains null characters, or characters not representable in the given encoding.