Encodes a string into a ByteArray containing the UTF-8 representation of the string.
The bytes containing the UTF-8 representation of the string
The string to encode.